Пример #1
0
        public void DefinedFakeOptionsBuilderConstructorArgumentsByList(
            ConstructorArgumentsSetByList fake)
        {
            "When a fake is created for a type that has an options builder defined"
            .x(() => fake = A.Fake <ConstructorArgumentsSetByList>());

            "Then the fake will be created using the constructor arguments"
            .x(() => fake.ConstructorArgument.Should().Be(typeof(ConstructorArgumentsSetByListOptionsBuilder).Name));
        }
Пример #2
0
        public static void DefinedFakeOptionsBuilderConstructorArgumentsByList(
            ConstructorArgumentsSetByList fake)
        {
            "Given a type with a constructor that requires parameters"
            .See <ConstructorArgumentsSetByList>();

            "And the type has an implicit options builder defined"
            .See <ConstructorArgumentsSetByList>();

            "And the options builder updates the options to provide constructor arguments using a list"
            .See <ConstructorArgumentsSetByListOptionsBuilder>(_ => _.BuildOptions);

            "When I create a fake of the type"
            .x(() => fake = A.Fake <ConstructorArgumentsSetByList>());

            "Then it is created using the constructor arguments"
            .x(() => fake.ConstructorArgument.Should().Be(typeof(ConstructorArgumentsSetByListOptionsBuilder).Name));
        }