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

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

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

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

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

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