-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated editorconfig and auto-cleaned source (#38)
- Loading branch information
Showing
19 changed files
with
271 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/BuilderGenerator.UnitTests/Examples/InputWithoutInternals.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using BuilderGenerator; | ||
|
||
namespace BuilderGenerator.UnitTests | ||
{ | ||
public class Person | ||
{ | ||
public string FirstName { get; set; } | ||
public string LastName { get; set; } | ||
internal string InternalString { get; set; } | ||
} | ||
|
||
[BuilderFor(typeof(Person), false)] | ||
public partial class PersonBuilderWithoutInternals | ||
{ | ||
} | ||
} |
87 changes: 87 additions & 0 deletions
87
src/BuilderGenerator.UnitTests/Examples/OutputWithInternals.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
#nullable disable | ||
|
||
using System.CodeDom.Compiler; | ||
using BuilderGenerator; | ||
|
||
namespace BuilderGenerator.UnitTests | ||
{ | ||
public partial class PersonBuilderWithInternals : BuilderGenerator.Builder<BuilderGenerator.UnitTests.Person> | ||
{ | ||
public System.Lazy<string> FirstName = new System.Lazy<string>(() => default(string)); | ||
public System.Lazy<string> InternalString = new System.Lazy<string>(() => default(string)); | ||
public System.Lazy<string> LastName = new System.Lazy<string>(() => default(string)); | ||
|
||
public override BuilderGenerator.UnitTests.Person Build() | ||
{ | ||
if (Object?.IsValueCreated != true) | ||
{ | ||
Object = new System.Lazy<BuilderGenerator.UnitTests.Person>(() => | ||
{ | ||
var result = new BuilderGenerator.UnitTests.Person | ||
{ | ||
FirstName = FirstName.Value, | ||
InternalString = InternalString.Value, | ||
LastName = LastName.Value, | ||
}; | ||
return result; | ||
}); | ||
|
||
PostProcess(Object.Value); | ||
} | ||
|
||
return Object.Value; | ||
} | ||
|
||
public PersonBuilderWithInternals WithFirstName(string value) | ||
{ | ||
return WithFirstName(() => value); | ||
} | ||
|
||
public PersonBuilderWithInternals WithFirstName(System.Func<string> func) | ||
{ | ||
FirstName = new System.Lazy<string>(func); | ||
return this; | ||
} | ||
|
||
public PersonBuilderWithInternals WithoutFirstName() | ||
{ | ||
FirstName = new System.Lazy<string>(() => default(string)); | ||
return this; | ||
} | ||
|
||
public PersonBuilderWithInternals WithInternalString(string value) | ||
{ | ||
return WithInternalString(() => value); | ||
} | ||
|
||
public PersonBuilderWithInternals WithInternalString(System.Func<string> func) | ||
{ | ||
InternalString = new System.Lazy<string>(func); | ||
return this; | ||
} | ||
|
||
public PersonBuilderWithInternals WithoutInternalString() | ||
{ | ||
InternalString = new System.Lazy<string>(() => default(string)); | ||
return this; | ||
} | ||
|
||
public PersonBuilderWithInternals WithLastName(string value) | ||
{ | ||
return WithLastName(() => value); | ||
} | ||
|
||
public PersonBuilderWithInternals WithLastName(System.Func<string> func) | ||
{ | ||
LastName = new System.Lazy<string>(func); | ||
return this; | ||
} | ||
|
||
public PersonBuilderWithInternals WithoutLastName() | ||
{ | ||
LastName = new System.Lazy<string>(() => default(string)); | ||
return this; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.