コード例 #1
0
 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);
 }
コード例 #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);
 }
コード例 #4
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));
 }
コード例 #5
0
ファイル: ModifyTests.cs プロジェクト: kilfour/QuickGenerate
 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});
 }
コード例 #7
0
 public CustomizeTypeSpecificStringLengthTests()
 {
     domainGenerator =
         new DomainGenerator()
         .With <SomethingToGenerate>(g => g.Length(e => e.MyProperty, 5))
         .With <SomethingToGenerate>(g => g.Length(e => e.MyOtherProperty, 3, 10));
 }
コード例 #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));
 }
コード例 #9
0
 public CustomizeTypeActionOneParameterMethodTests()
 {
     domainGenerator =
         new DomainGenerator()
         .With <SomethingToGenerate>(g => g.Method <int>((e, i) => e.MyMethod(i)))
         .With(42);
 }
コード例 #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));
 }
コード例 #11
0
 public ComponentsTests()
 {
     domainGenerator =
         new DomainGenerator()
             .Component<SomeComponent>()
             .With(42);
 }
コード例 #12
0
 public CustomizeTypeSpecificStringLengthTests()
 {
     domainGenerator =
         new DomainGenerator()
             .With<SomethingToGenerate>(g => g.Length(e => e.MyProperty, 5))
             .With<SomethingToGenerate>(g => g.Length(e => e.MyOtherProperty, 3, 10));
 }
コード例 #13
0
 public ComponentsTests()
 {
     domainGenerator =
         new DomainGenerator()
         .Component <SomeComponent>()
         .With(42);
 }
コード例 #14
0
 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);
 }
コード例 #16
0
 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));
 }
コード例 #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());
 }
コード例 #18
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());
 }
コード例 #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);
 }
コード例 #20
0
 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));
 }
コード例 #21
0
 public OneToManyUsingConstructorTests()
 {
     domainGenerator =
         new DomainGenerator()
         .With(42)
         .OneToMany <SomeParent, SomeChild>(
             1,
             one => new SomeChild(one),
             (one, many) => one.Children.Add(many));
 }
コード例 #22
0
 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));
 }
コード例 #23
0
 public OneToManyUsingConstructorTests()
 {
     domainGenerator =
         new DomainGenerator()
             .With(42)
             .OneToMany<SomeParent, SomeChild>(
                 1,
                 one => new SomeChild(one),
                 (one, many) => one.Children.Add(many));
 }
コード例 #24
0
 public CustomizeTypeSpecificCompositeValueTests()
 {
     domainGenerator =
         new DomainGenerator()
         .With(new SomethingToGenerate {
         Property = 42, OtherProperty = 11
     })
         .With(new SomethingDerivedToGenerate {
         Property = 42, OtherProperty = 11
     });
 }
コード例 #25
0
 public PolymorphicOneToManyTests()
 {
     domainGenerator =
         new DomainGenerator()
             .OneToMany<DerivedOne, Many>(
                 1,
                 (one, many) =>
                     {
                         one.Manies.Add(many);
                         many.One = one;
                     });
 }
コード例 #26
0
 public PolymorphicOneToManyTests()
 {
     domainGenerator =
         new DomainGenerator()
         .OneToMany <DerivedOne, Many>(
             1,
             (one, many) =>
     {
         one.Manies.Add(many);
         many.One = one;
     });
 }
コード例 #27
0
 public ExplicitPolymorphicOneToOneTests()
 {
     domainGenerator =
         new DomainGenerator()
         .With(
             () =>
             new SomethingBaseToGenerate[]
     {
         new SomethingDerivedToGenerate(),
         new SomethingElseDerivedToGenerate()
     }.PickOne())
         .OneToOne <SomethingToGenerate, SomethingBaseToGenerate>((l, r) => l.MyMethod(r));
 }
コード例 #28
0
 public ExplicitPolymorphicOneToOneTests()
 {
     domainGenerator =
         new DomainGenerator()
             .With(
                     () =>
                         new SomethingBaseToGenerate[]
                             {
                                 new SomethingDerivedToGenerate(),
                                 new SomethingElseDerivedToGenerate()
                             }.PickOne())
             .OneToOne<SomethingToGenerate, SomethingBaseToGenerate>((l, r) => l.MyMethod(r));
 }
コード例 #29
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));
 }
コード例 #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));
 }
コード例 #31
0
 public CustomizeTypeSpecificValueTests()
 {
     domainGenerator =
         new DomainGenerator()
         .With <SomethingToGenerate>(g => g.For(e => e.Property, 42));
 }
コード例 #32
0
 public CustomizeTypeDynamicValueConventionTests()
 {
     domainGenerator =
         new DomainGenerator()
             .With<Something>(g => g.For(e => e.Value, GetNextProductId));
 }
コード例 #33
0
 public DynamicValueConventionTests()
 {
     domainGenerator =
         new DomainGenerator()
         .With(mi => mi.Name == "MyProperty", () => GetNextProductId());
 }
コード例 #34
0
 public CustomizeTypeDynamicValueConventionTests()
 {
     domainGenerator =
         new DomainGenerator()
         .With <Something>(g => g.For(e => e.Value, GetNextProductId));
 }
コード例 #35
0
 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)));
 }
コード例 #37
0
 public ExplicitOneToOneTests()
 {
     domainGenerator =
         new DomainGenerator()
             .OneToOne<SomethingToGenerate, SomethingElseToGenerate>((l, r) => l.MyMethod(r));
 }
コード例 #38
0
 public ReplacingPrimitiveGeneratorsWithConstantValueTests()
 {
     domainGenerator =
         new DomainGenerator()
         .With(42);
 }
コード例 #39
0
 public CustomizeTypeSpecificValueTests()
 {
     domainGenerator =
         new DomainGenerator()
             .With<SomethingToGenerate>(g => g.For(e => e.Property, 42));
 }
コード例 #40
0
 public CustomizeTypePossibleValuesTests()
 {
     domainGenerator =
         new DomainGenerator()
             .With<Something>(g => g.For(e => e.Value, 42, 43));
 }
コード例 #41
0
 public IgnoreConventionTests()
 {
     domainGenerator = new DomainGenerator().With(opt => opt.Ignore(mi => mi.Name == "Id"));
 }
コード例 #42
0
 public ConstructorPreferenceTests()
 {
     domainGenerator =
         new DomainGenerator()
             .With(42);
 }
コード例 #43
0
 public DynamicValueConventionTests()
 {
     domainGenerator =
         new DomainGenerator()
             .With(mi => mi.Name == "MyProperty", () => GetNextProductId());
 }
コード例 #44
0
 public IgnoreConventionTests()
 {
     domainGenerator = new DomainGenerator().With(opt => opt.Ignore(mi => mi.Name == "Id"));
 }
コード例 #45
0
 public CustomizeTypeMultipleSpecificGeneratorTests()
 {
     domainGenerator =
         new DomainGenerator()
         .With <Something>(g => g.For(e => e.Value, new IntGenerator(42, 42), new IntGenerator(43, 43)));
 }
コード例 #46
0
 public WeaklyTypedOneTests()
 {
     domainGenerator = new DomainGenerator().With(42);
 }
コード例 #47
0
 public CustomizeTypePossibleValuesTests()
 {
     domainGenerator =
         new DomainGenerator()
         .With <Something>(g => g.For(e => e.Value, 42, 43));
 }