public void It_should_fill_all_properties_recursively(ISimpleFactory <Customer> factory) { var customer = factory.Many(3).Build().ToArray(); customer[0].Address.ZipCode.Should().Be("ZipCode1"); customer[1].Address.ZipCode.Should().Be("ZipCode2"); customer[2].Address.ZipCode.Should().Be("ZipCode3"); }
public void It_should_fill_all_objects_properties_with_sequential_numbers(ISimpleFactory <Customer> factory) { var customers = factory.Many(3).Build().ToArray(); customers[0].Birthday.Should().Be(25.December(2020).At(22.Hours())); customers[1].Birthday.Should().Be(25.December(2020).At(23.Hours())); customers[2].Birthday.Should().Be(26.December(2020).At(0.Hours())); }
public void It_should_be_possible_to_chain_another_one_after_many(ISimpleFactory <Person> factory) { var persons = factory .Many(2).With(x => x.Age = 99) .PlusOne().With(x => x.Age = 100) .Build() .ToList(); persons.Should().HaveCount(3); persons[0].Age.Should().Be(99); persons[1].Age.Should().Be(99); persons[2].Age.Should().Be(100); }
public void It_should_fill_all_objects_properties_with_sequential_numbers(ISimpleFactory <Customer> factory) { var customers = factory.Many(3).Build().ToArray(); customers[0].Name.Should().Be("Name1"); customers[0].Age.Should().Be(1); customers[0].Birthday.Should().Be(1.January(1753)); customers[1].Name.Should().Be("Name2"); customers[1].Age.Should().Be(2); customers[1].Birthday.Should().Be(2.January(1753)); customers[2].Name.Should().Be("Name3"); customers[2].Age.Should().Be(3); customers[2].Birthday.Should().Be(3.January(1753)); }
public void It_should_fill_all_nullable_properties_of_supported_types(ISimpleFactory <Customer> factory) { var customers = factory.Many(2).Build().ToArray(); var secondCustomer = customers[1]; secondCustomer.NullableByteProperty.Should().Be(2); secondCustomer.NullableShortProperty.Should().Be(2); secondCustomer.NullableUShortProperty.Should().Be(2); secondCustomer.NullableIntProperty.Should().Be(2); secondCustomer.NullableUIntProperty.Should().Be(2); secondCustomer.NullableLongProperty.Should().Be(2); secondCustomer.NullableULongProperty.Should().Be(2); secondCustomer.NullableFloatProperty.Should().Be(2f); secondCustomer.NullableDoubleProperty.Should().Be(2d); secondCustomer.NullableDecimalProperty.Should().Be(2m); secondCustomer.NullableDateTimeProperty.Should().Be(RecursiveTransformFactoryOptions.DefaultStartDate.AddDays(1)); }