-
-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
List-to-List MergeManyChangeSets (#780)
Implements the MergeManyChangeSets operator for when both the Source and the Child changesets are List ChangeSets.
- Loading branch information
Showing
11 changed files
with
717 additions
and
58 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
| ||
using System; | ||
|
||
namespace DynamicData.Tests.Domain; | ||
|
||
internal class AnimalOwner(string name) : IDisposable | ||
{ | ||
public Guid Id { get; } = Guid.NewGuid(); | ||
|
||
public string Name => name; | ||
|
||
public ISourceList<Animal> Animals { get; } = new SourceList<Animal>(); | ||
|
||
public void Dispose() => Animals.Dispose(); | ||
} |
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,53 @@ | ||
using Bogus; | ||
|
||
namespace DynamicData.Tests.Domain; | ||
|
||
internal static class Fakers | ||
{ | ||
const int MinAnimals = 3; | ||
#if DEBUG | ||
const int MaxAnimals = 7; | ||
#else | ||
const int MaxAnimals = 23; | ||
#endif | ||
|
||
private static readonly string[][] AnimalTypeNames = | ||
[ | ||
// Mammal | ||
["Dog", "Cat", "Ferret", "Hamster", "Gerbil", "Cavie", "Mouse", "Pot-Bellied Pig"], | ||
|
||
// Reptile | ||
["Corn Snake", "Python", "Gecko", "Skink", "Monitor Lizard", "Chameleon", "Tortoise", "Box Turtle", "Iguana"], | ||
|
||
// Fish | ||
["Betta", "Goldfish", "Angelfish", "Catfish", "Guppie", "Mollie", "Neon Tetra", "Platie", "Koi"], | ||
|
||
// Amphibian | ||
["Frog", "Toad", "Salamander"], | ||
|
||
// Bird | ||
["Parakeet", "Cockatoo", "Parrot", "Finch", "Conure", "Lovebird", "Cockatiel"], | ||
]; | ||
|
||
public static Faker<Animal> Animal { get; } = | ||
new Faker<Animal>() | ||
.CustomInstantiator(faker => | ||
{ | ||
var family = faker.PickRandom<AnimalFamily>(); | ||
var type = faker.PickRandom(AnimalTypeNames[(int)family]); | ||
var name = faker.Commerce.ProductAdjective(); | ||
|
||
return new Animal(name, type, family); | ||
}); | ||
|
||
public static Faker<AnimalOwner> AnimalOwner { get; } = | ||
new Faker<AnimalOwner>() | ||
.CustomInstantiator(faker => | ||
{ | ||
var result = new AnimalOwner(faker.Person.FullName); | ||
|
||
result.Animals.AddRange(Animal.Generate(faker.Random.Number(MinAnimals, MaxAnimals))); | ||
|
||
return result; | ||
}); | ||
} |
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.