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);
 }
Esempio n. 3
0
 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));
 }
Esempio n. 5
0
 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));
 }
Esempio n. 8
0
 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));
 }
Esempio n. 9
0
 public CustomizeTypeActionOneParameterMethodTests()
 {
     domainGenerator =
         new DomainGenerator()
         .With <SomethingToGenerate>(g => g.Method <int>((e, i) => e.MyMethod(i)))
         .With(42);
 }
Esempio n. 10
0
 public ModifyTests()
 {
     domainGenerator =
         new DomainGenerator()
         .With(opt => opt.Ignore(mi => mi.Name == "Id"))
         .With <SomethingToGenerate>(g => g.For(e => e.MyProperty, 42, 43));
 }
Esempio n. 11
0
 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));
 }
Esempio n. 13
0
 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));
 }
Esempio n. 17
0
 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());
 }
Esempio n. 19
0
 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;
     });
 }
Esempio n. 27
0
 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));
 }
Esempio n. 30
0
 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));
 }
Esempio n. 31
0
 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));
 }
Esempio n. 33
0
 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));
 }
Esempio n. 38
0
 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));
 }
Esempio n. 41
0
 public IgnoreConventionTests()
 {
     domainGenerator = new DomainGenerator().With(opt => opt.Ignore(mi => mi.Name == "Id"));
 }
 public ConstructorPreferenceTests()
 {
     domainGenerator =
         new DomainGenerator()
             .With(42);
 }
 public DynamicValueConventionTests()
 {
     domainGenerator =
         new DomainGenerator()
             .With(mi => mi.Name == "MyProperty", () => GetNextProductId());
 }
 public IgnoreConventionTests()
 {
     domainGenerator = new DomainGenerator().With(opt => opt.Ignore(mi => mi.Name == "Id"));
 }
Esempio n. 45
0
 public CustomizeTypeMultipleSpecificGeneratorTests()
 {
     domainGenerator =
         new DomainGenerator()
         .With <Something>(g => g.For(e => e.Value, new IntGenerator(42, 42), new IntGenerator(43, 43)));
 }
Esempio n. 46
0
 public WeaklyTypedOneTests()
 {
     domainGenerator = new DomainGenerator().With(42);
 }
 public CustomizeTypePossibleValuesTests()
 {
     domainGenerator =
         new DomainGenerator()
         .With <Something>(g => g.For(e => e.Value, 42, 43));
 }