public CustomizeTypeIgnoreTests() { domainGenerator = new DomainGenerator() .With <Something>(g => g.Ignore(e => e.Value)) .With <SomethingElse>(g => g.Ignore(e => e.Value)); }
public CustomizeTypeActionTwoParameterMethod_MultipleTimes_Tests() { domainGenerator = new DomainGenerator() .With<SomethingToGenerate>(g => g.Method<int, int>(3, (e, i1, i2) => e.MyMethod(i1, i2))) .With(42); }
public CustomizeTypeActionTwoParameterMethod_MultipleTimes_Tests() { domainGenerator = new DomainGenerator() .With <SomethingToGenerate>(g => g.Method <int, int>(3, (e, i1, i2) => e.MyMethod(i1, i2))) .With(42); }
public MultipleOneToManiesTests() { domainGenerator = new DomainGenerator() .OneToMany<SomeParent, SomeChild>(1, (one, many) => one.Children.Add(many)) .OneToMany<SomeParent, SomeOtherChild>(1, (one, many) => one.OtherChildren.Add(many)); }
public ModifyTests() { domainGenerator = new DomainGenerator() .With(opt => opt.Ignore(mi => mi.Name == "Id")) .With<SomethingToGenerate>(g => g.For(e => e.MyProperty, 42, 43)); }
public CustomizeTypeSpecificCompositeValueTests() { domainGenerator = new DomainGenerator() .With(new SomethingToGenerate {Property = 42, OtherProperty = 11}) .With(new SomethingDerivedToGenerate {Property = 42, OtherProperty = 11}); }
public CustomizeTypeSpecificStringLengthTests() { domainGenerator = new DomainGenerator() .With <SomethingToGenerate>(g => g.Length(e => e.MyProperty, 5)) .With <SomethingToGenerate>(g => g.Length(e => e.MyOtherProperty, 3, 10)); }
public MultipleOneToManiesTests() { domainGenerator = new DomainGenerator() .OneToMany <SomeParent, SomeChild>(1, (one, many) => one.Children.Add(many)) .OneToMany <SomeParent, SomeOtherChild>(1, (one, many) => one.OtherChildren.Add(many)); }
public CustomizeTypeActionOneParameterMethodTests() { domainGenerator = new DomainGenerator() .With <SomethingToGenerate>(g => g.Method <int>((e, i) => e.MyMethod(i))) .With(42); }
public ModifyTests() { domainGenerator = new DomainGenerator() .With(opt => opt.Ignore(mi => mi.Name == "Id")) .With <SomethingToGenerate>(g => g.For(e => e.MyProperty, 42, 43)); }
public ComponentsTests() { domainGenerator = new DomainGenerator() .Component<SomeComponent>() .With(42); }
public CustomizeTypeSpecificStringLengthTests() { domainGenerator = new DomainGenerator() .With<SomethingToGenerate>(g => g.Length(e => e.MyProperty, 5)) .With<SomethingToGenerate>(g => g.Length(e => e.MyOtherProperty, 3, 10)); }
public ComponentsTests() { domainGenerator = new DomainGenerator() .Component <SomeComponent>() .With(42); }
public CustomizeTypeIgnoreTests() { domainGenerator = new DomainGenerator() .With<Something>(g => g.Ignore(e => e.Value)) .With<SomethingElse>(g => g.Ignore(e => e.Value)); }
public CustomizeTypeActionTwoParameterMethodTests() { domainGenerator = new DomainGenerator() .With<SomethingToGenerate>(g => g.Method<int, string>((e, i, s) => e.MyMethod(i, s))) .With("TEST") .With(42); }
public ForEachOnOneToManyOrderTests() { domainGenerator = new DomainGenerator() .OneToMany <One, Two>(1, (one, many) => one.Children.Add(many)) .OneToMany <Two, Three>(1, (one, many) => one.Children.Add(many)) .ForEach <Base>(o => objects.Add(o)); }
public ForEachNullReferenceBug() { domainGenerator = new DomainGenerator() .With <SomethingElseToGenerate>(opt => opt.Use <SomethingDerivedToGenerate>().Use <SomethingElseDerivedToGenerate>()) .OneToOne <SomethingToGenerate, SomethingElseToGenerate>((l, r) => l.MyMethod(r)) .ForEach <SomethingToGenerate>(s => s.SomethingElse.DoSomething()); }
public ForEachNullReferenceBug() { domainGenerator = new DomainGenerator() .With<SomethingElseToGenerate>(opt => opt.Use<SomethingDerivedToGenerate>().Use<SomethingElseDerivedToGenerate>()) .OneToOne<SomethingToGenerate, SomethingElseToGenerate>((l, r) => l.MyMethod(r)) .ForEach<SomethingToGenerate>(s => s.SomethingElse.DoSomething()); }
public CustomizeTypeActionTwoParameterMethodTests() { domainGenerator = new DomainGenerator() .With <SomethingToGenerate>(g => g.Method <int, string>((e, i, s) => e.MyMethod(i, s))) .With("TEST") .With(42); }
public ComplexOneToManyTests() { domainGenerator = new DomainGenerator() .OneToMany<SomeParent, SomeThingInCommon>(1, (one, many) => one.Common.Add(many)) .OneToMany<SomeParent, SomeChild>( 1, one => new SomeChild(one.Common.PickOne()), (one, many) => one.Children.Add(many)); }
public OneToManyUsingConstructorTests() { domainGenerator = new DomainGenerator() .With(42) .OneToMany <SomeParent, SomeChild>( 1, one => new SomeChild(one), (one, many) => one.Children.Add(many)); }
public ComplexOneToManyTests() { domainGenerator = new DomainGenerator() .OneToMany <SomeParent, SomeThingInCommon>(1, (one, many) => one.Common.Add(many)) .OneToMany <SomeParent, SomeChild>( 1, one => new SomeChild(one.Common.PickOne()), (one, many) => one.Children.Add(many)); }
public OneToManyUsingConstructorTests() { domainGenerator = new DomainGenerator() .With(42) .OneToMany<SomeParent, SomeChild>( 1, one => new SomeChild(one), (one, many) => one.Children.Add(many)); }
public CustomizeTypeSpecificCompositeValueTests() { domainGenerator = new DomainGenerator() .With(new SomethingToGenerate { Property = 42, OtherProperty = 11 }) .With(new SomethingDerivedToGenerate { Property = 42, OtherProperty = 11 }); }
public PolymorphicOneToManyTests() { domainGenerator = new DomainGenerator() .OneToMany<DerivedOne, Many>( 1, (one, many) => { one.Manies.Add(many); many.One = one; }); }
public PolymorphicOneToManyTests() { domainGenerator = new DomainGenerator() .OneToMany <DerivedOne, Many>( 1, (one, many) => { one.Manies.Add(many); many.One = one; }); }
public ExplicitPolymorphicOneToOneTests() { domainGenerator = new DomainGenerator() .With( () => new SomethingBaseToGenerate[] { new SomethingDerivedToGenerate(), new SomethingElseDerivedToGenerate() }.PickOne()) .OneToOne <SomethingToGenerate, SomethingBaseToGenerate>((l, r) => l.MyMethod(r)); }
public ExplicitPolymorphicOneToOneTests() { domainGenerator = new DomainGenerator() .With( () => new SomethingBaseToGenerate[] { new SomethingDerivedToGenerate(), new SomethingElseDerivedToGenerate() }.PickOne()) .OneToOne<SomethingToGenerate, SomethingBaseToGenerate>((l, r) => l.MyMethod(r)); }
public CustomizeTypePolymorphism() { domainGenerator = new DomainGenerator() .With( () => new[] { new BaseClass(), new DervivedOne(), new DervivedTwo() }.PickOne()) .With( () => new AbstractBaseClass[] { new AbstractDervivedOne(), new AbstractDervivedTwo() }.PickOne()) .With<DervivedTwo>(opt => opt.For(e => e.TheAnswer, 42)); }
public CustomizeTypePolymorphism() { domainGenerator = new DomainGenerator() .With( () => new[] { new BaseClass(), new DervivedOne(), new DervivedTwo() }.PickOne()) .With( () => new AbstractBaseClass[] { new AbstractDervivedOne(), new AbstractDervivedTwo() }.PickOne()) .With <DervivedTwo>(opt => opt.For(e => e.TheAnswer, 42)); }
public CustomizeTypeSpecificValueTests() { domainGenerator = new DomainGenerator() .With <SomethingToGenerate>(g => g.For(e => e.Property, 42)); }
public CustomizeTypeDynamicValueConventionTests() { domainGenerator = new DomainGenerator() .With<Something>(g => g.For(e => e.Value, GetNextProductId)); }
public DynamicValueConventionTests() { domainGenerator = new DomainGenerator() .With(mi => mi.Name == "MyProperty", () => GetNextProductId()); }
public CustomizeTypeDynamicValueConventionTests() { domainGenerator = new DomainGenerator() .With <Something>(g => g.For(e => e.Value, GetNextProductId)); }
public ConstructorPreferenceTests() { domainGenerator = new DomainGenerator() .With(42); }
public CustomizeTypeMultipleSpecificGeneratorTests() { domainGenerator = new DomainGenerator() .With<Something>(g => g.For(e => e.Value, new IntGenerator(42, 42), new IntGenerator(43, 43))); }
public ExplicitOneToOneTests() { domainGenerator = new DomainGenerator() .OneToOne<SomethingToGenerate, SomethingElseToGenerate>((l, r) => l.MyMethod(r)); }
public ReplacingPrimitiveGeneratorsWithConstantValueTests() { domainGenerator = new DomainGenerator() .With(42); }
public CustomizeTypeSpecificValueTests() { domainGenerator = new DomainGenerator() .With<SomethingToGenerate>(g => g.For(e => e.Property, 42)); }
public CustomizeTypePossibleValuesTests() { domainGenerator = new DomainGenerator() .With<Something>(g => g.For(e => e.Value, 42, 43)); }
public IgnoreConventionTests() { domainGenerator = new DomainGenerator().With(opt => opt.Ignore(mi => mi.Name == "Id")); }
public CustomizeTypeMultipleSpecificGeneratorTests() { domainGenerator = new DomainGenerator() .With <Something>(g => g.For(e => e.Value, new IntGenerator(42, 42), new IntGenerator(43, 43))); }
public WeaklyTypedOneTests() { domainGenerator = new DomainGenerator().With(42); }
public CustomizeTypePossibleValuesTests() { domainGenerator = new DomainGenerator() .With <Something>(g => g.For(e => e.Value, 42, 43)); }