コード例 #1
0
        public void ItShould_Remove_Last_Document()
        {
            _removeSomeCommand.Execute();

            _documentCommandFactoryMock.Verify(v => v.CreateCommand(It.Is <IClosedDocument>(p => p == NullDocument.Instance)), Times.Exactly(2));
            _documentCommandMock.Verify(v => v.Execute(), Times.Exactly(2));
            _documentHistoryCommandsMock.Verify(v => v.Remove(It.IsAny <IClosedDocument[]>()), Times.Once);
        }
コード例 #2
0
        public void ItShould_Handle_Nulls()
        {
            var command = new RemoveSomeCommand(null, null, NullDocument.Instance);

            command.Execute();

            _documentHistoryCommandsMock.Verify(v => v.RemoveLast(), Times.Never);
            _documentCommandFactoryMock.Verify(v => v.CreateCommand(It.IsAny <IClosedDocument>()), Times.Never);
            _documentCommandMock.Verify(v => v.Execute(), Times.Never);
        }