示例#1
0
        public void Rethink_NullDocumentWithoutSuccessor_ReturnsNull()
        {
            var archivist = new DoNothingArchivist {
                Successor = null
            };
            var result = archivist.Rethink(null);

            Assert.Null(result);
        }
示例#2
0
        public void Rethink_WithoutSuccessor_ReturnsInitialObject()
        {
            var archivist = new DoNothingArchivist {
                Successor = null
            };
            var document = new Document();
            var result   = archivist.Rethink(document);

            Assert.Equal(document, result);
        }
示例#3
0
        public void Rethink_WithSuccessor_CallsSuccessor()
        {
            var archivist     = new DoNothingArchivist();
            var archivistMock = new Mock <IArchivist>();

            archivistMock.Setup(it => it.Successor).Returns((IArchivist)null);
            archivist.Successor = archivistMock.Object;
            var document = new Document();

            archivist.Rethink(document);
            archivistMock.Verify(it => it.Rethink(document), Times.Once);
        }