コード例 #1
0
        public void Builder_Should_BeAbleToHandleGenerics(int sourceNumber, SomeClass sourceSomeClass, Person sourcePerson)
        {
            dynamic genericClassBuilder = new FluentBuilder <SoMuchGenericClass <int, SomeClass, Person> >();

            genericClassBuilder.WithFirstProperty(sourceNumber).WithSecondProperty(sourceSomeClass).WithThirdProperty(sourcePerson);

            SoMuchGenericClass <int, SomeClass, Person> genericClass = genericClassBuilder.Get();

            genericClass.FirstProperty.ShouldBe(sourceNumber);
            genericClass.SecondProperty.ShouldBe(sourceSomeClass);
            genericClass.ThirdProperty.ShouldBe(sourcePerson);
        }