-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now supports Half, BigIntegr, Exception
Tests for record struct, recursive enumerable constructor
- Loading branch information
Showing
22 changed files
with
174 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System; | ||
using System.Numerics; | ||
using Soenneker.Utils.AutoBogus.Context; | ||
using Soenneker.Utils.AutoBogus.Generators.Abstract; | ||
|
||
namespace Soenneker.Utils.AutoBogus.Generators.Types; | ||
|
||
internal sealed class BigIntegerGenerator : IAutoFakerGenerator | ||
{ | ||
object IAutoFakerGenerator.Generate(AutoFakerContext context) | ||
{ | ||
return new BigInteger(context.Faker.Random.Int()); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
using Soenneker.Utils.AutoBogus.Context; | ||
using Soenneker.Utils.AutoBogus.Generators.Abstract; | ||
|
||
namespace Soenneker.Utils.AutoBogus.Generators.Types; | ||
|
||
internal sealed class ExceptionGenerator: IAutoFakerGenerator | ||
{ | ||
object IAutoFakerGenerator.Generate(AutoFakerContext context) | ||
{ | ||
return new Exception(context.Faker.Lorem.Sentence()); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
using Soenneker.Utils.AutoBogus.Context; | ||
using Soenneker.Utils.AutoBogus.Generators.Abstract; | ||
|
||
namespace Soenneker.Utils.AutoBogus.Generators.Types; | ||
|
||
internal sealed class HalfGenerator : IAutoFakerGenerator | ||
{ | ||
object IAutoFakerGenerator.Generate(AutoFakerContext context) | ||
{ | ||
return (Half)context.Faker.Random.Float(-65504, 65504); | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...Utils.AutoBogus.Tests/Dtos/IRepository.cs → ...oBogus.Tests/Dtos/Abstract/IRepository.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
2 changes: 1 addition & 1 deletion
2
....Utils.AutoBogus.Tests/Dtos/ITimestamp.cs → ...toBogus.Tests/Dtos/Abstract/ITimestamp.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
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
2 changes: 1 addition & 1 deletion
2
...oBogus.Tests/Dtos/Complex/CalendarItem.cs → ...toBogus.Tests/Dtos/Simple/CalendarItem.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
8 changes: 8 additions & 0 deletions
8
test/Soenneker.Utils.AutoBogus.Tests/Dtos/Simple/TestClassWithBigInteger.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,8 @@ | ||
using System.Numerics; | ||
|
||
namespace Soenneker.Utils.AutoBogus.Tests.Dtos.Simple; | ||
|
||
internal class TestClassWithBigInteger | ||
{ | ||
public BigInteger BigInteger { get; set; } | ||
} |
8 changes: 8 additions & 0 deletions
8
test/Soenneker.Utils.AutoBogus.Tests/Dtos/Simple/TestClassWithException.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,8 @@ | ||
using System; | ||
|
||
namespace Soenneker.Utils.AutoBogus.Tests.Dtos.Simple; | ||
|
||
public class TestClassWithException | ||
{ | ||
public Exception Exception { get; set; } | ||
} |
8 changes: 8 additions & 0 deletions
8
test/Soenneker.Utils.AutoBogus.Tests/Dtos/Simple/TestClassWithNumber.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,8 @@ | ||
using System.Numerics; | ||
|
||
namespace Soenneker.Utils.AutoBogus.Tests.Dtos.Simple; | ||
|
||
internal class TestClassWithNumber<T> where T : INumber<T> | ||
{ | ||
public T Number { get; set; } | ||
} |
18 changes: 18 additions & 0 deletions
18
...oenneker.Utils.AutoBogus.Tests/Dtos/Simple/TestClassWithRecursiveEnumerableConstructor.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,18 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace Soenneker.Utils.AutoBogus.Tests.Dtos.Simple; | ||
|
||
internal class TestClassWithRecursiveEnumerableConstructor | ||
{ | ||
public string? Name { get; set; } | ||
public int Age { get; set; } | ||
|
||
public IEnumerable<TestClassWithRecursiveEnumerableConstructor> Child { get; set; } | ||
|
||
public TestClassWithRecursiveEnumerableConstructor(string? name, int age, IEnumerable<TestClassWithRecursiveEnumerableConstructor> child) | ||
{ | ||
Name = name; | ||
Age = age; | ||
Child = child; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -3,5 +3,6 @@ | |
internal record TestRecord | ||
{ | ||
public string? Name { get; set; } | ||
|
||
public int Age { get; set; } | ||
} |
8 changes: 8 additions & 0 deletions
8
test/Soenneker.Utils.AutoBogus.Tests/Dtos/Simple/TestRecordStruct.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,8 @@ | ||
namespace Soenneker.Utils.AutoBogus.Tests.Dtos.Simple; | ||
|
||
internal record struct TestRecordStruct | ||
{ | ||
public string? Name { get; set; } | ||
|
||
public int Age { get; set; } | ||
} |
5 changes: 3 additions & 2 deletions
5
...utoBogus.Tests/Dtos/GenerateExtensions.cs → .../Extensions/ObjectAssertionsExtensions.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
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