CodeValue.CodeCommander.Tests.CommandProcessorTests.RerunBlockedCommand_CommandIsNewThusNotBlocked_ThrowException C# (CSharp) Méthode

RerunBlockedCommand_CommandIsNewThusNotBlocked_ThrowException() private méthode

        public void RerunBlockedCommand_CommandIsNewThusNotBlocked_ThrowException()
        {
            bool wasThrown = false;
            Exception thrownException = null;

            var fakeFilterManager = A.Fake<IFilterManager>();
            A.CallTo(() => fakeFilterManager.Process(A<CommandBase>.Ignored)).Returns(true);

            var processor = new CommandProcessor(null, fakeFilterManager);

            var command = new TestCommand(CommandState.New);

            try
            {
                processor.RerunBlockedCommand(command);

            }
            catch (CommandProcessorException ex)
            {
                thrownException = ex;
                wasThrown = true;
            }

            Assert.IsTrue(wasThrown);
            Assert.AreEqual("Command is not blocked", thrownException.Message);
        }
CommandProcessorTests