public void Builders_ShouldWork_With_NetFramework_461() { DynamicFluentBuilder <TestEntity> builder = new DynamicFluentBuilder <TestEntity>(); TestEntity result = builder.With(x => x.PropertyA, "Foo").build(); result.PropertyA.Should().Be("Foo"); }
public void DynamicBuilder_ShouldBeUsable() { DynamicFluentBuilder <TestEntity> builder = new DynamicFluentBuilder <TestEntity>(); TestEntity result = builder.With(x => x.PropertyA, "Foo").build(); result.PropertyA.Should().Be("Foo"); }
public WhenBuildingTheObject_AfterSpecifyingDynamicPropertyBuilder_UsingHaving() { _expectedValue = new TestClass { FirstName = "Bob", LastName = "Smith" }; FluentBuilder <TestClass> propertyBuilder = new DynamicFluentBuilder <TestClass>().AliasFor(_expectedValue); _result = Sut.Having(x => x.ReferenceProperty, propertyBuilder).build(); }
public WhenBuildingTheObject_AfterSpecifyingListPropertyBuilders_UsingWithListOf() { // Create a builder that will return the expected value. _firstExpectedValue = new TestClass { FirstName = "Bob", LastName = "Smith" }; FluentBuilder <TestClass> firstValueBuilder = new DynamicFluentBuilder <TestClass>().AliasFor(_firstExpectedValue); _secondExpectedValue = new TestClass { FirstName = "Harry", LastName = "Johnson" }; FluentBuilder <TestClass> secondValueBuilder = new DynamicFluentBuilder <TestClass>().AliasFor(_secondExpectedValue); _result = Sut.WithListOf(x => x.ListProperty, firstValueBuilder, secondValueBuilder).build(); }
protected Given_ADynamicFluentBuilder_ThatUsesDefaultValueConventions() { Fluency.Initialize(x => x.UseDefaultValueConventions()); Sut = new DynamicFluentBuilder <TestClass>(); }