コード例 #1
0
        public void InvokeCommand_ExpectServiceManagerReceivedCallOnExecuteNonQuery()
        {
            var serviceManager = Substitute.For <IDbManager>();
            var serviceCommand = Substitute.For <INonQueryCommand <bool> >();

            var sut = new NonQueryCommandInvoker <bool>(serviceCommand);

            sut.Invoke(serviceManager);

            serviceManager.Received().ExecuteNonQuery(Arg.Any <IDbCommand>());
        }
コード例 #2
0
        public void InvokeCommandWithParameterFalse_ExpectOutputParameterTrue()
        {
            var parameterName = "key";

            var serviceCommand = new FakeNonQueryCommand(parameterName);
            var serviceManager = Substitute.For <IDbManager>();

            var sut = new NonQueryCommandInvoker <bool>(serviceCommand);

            var result = sut.Invoke(serviceManager);

            Assert.IsTrue(result);
        }