Represents a factory to create parameterized commands.
Inheritance: ITestCommandFactory
コード例 #1
0
        public void CreateWithNonParameterizedTestMethodReturnsEmpty()
        {
            var method = (MethodInfo)MethodBase.GetCurrentMethod();
            var sut = new ParameterizedCommandFactory();

            var actual = sut.Create(Reflector.Wrap(method), null);

            Assert.Empty(actual);
        }
コード例 #2
0
        public void CreateWithParameterizedTestMethodWithReturnValueReturnsCorrectMethod()
        {
            var method = Reflector.Wrap(new Methods<ParameterizedCommandFactoryTest>().Select(
                x => x.ParameterizedTestMethodWithReturnValue(null)));
            var sut = new ParameterizedCommandFactory();
            var factory = Mocked.Of<ISpecimenBuilderFactory>();

            var actual = sut.Create(method, factory).Single();

            var command = Assert.IsAssignableFrom<ParameterizedCommand>(actual);
            var context = Assert.IsAssignableFrom<ParameterizedCommandContext>(command.TestCommandContext);
            Assert.Equal(method, context.TestMethod);
            Assert.Equal(factory, context.BuilderFactory);
            Assert.Empty(context.ExplicitArguments);
        }
コード例 #3
0
 public void SutIsTestCommandFactory()
 {
     var sut = new ParameterizedCommandFactory();
     Assert.IsAssignableFrom<ITestCommandFactory>(sut);
 }