Exemple #1
0
        public void Rethink_WithoutSuccessorAndInvisibleDocument_ReturnsNullObject()
        {
            var archivist = new GetVisibleArchivist {
                Successor = null
            };
            var document = new Document {
                IsVisible = false
            };
            var result = archivist.Rethink(document);

            Assert.Null(result);
        }
Exemple #2
0
        public void Rethink_WithoutSuccessorAndVisibleDocument_ReturnsInitialObject()
        {
            var archivist = new GetVisibleArchivist {
                Successor = null
            };
            var document = new Document {
                IsVisible = true
            };
            var result = archivist.Rethink(document);

            Assert.Equal(document, result);
        }
Exemple #3
0
        public void Rethink_VisibleDocumentCallToSuccessor_ReturnsNullObject()
        {
            var archivistMock = new Mock <IArchivist>();

            archivistMock.Setup(it => it.Successor).Returns((IArchivist)null);
            var archivist = new GetVisibleArchivist {
                Successor = archivistMock.Object
            };
            var document = new Document {
                IsVisible = true
            };
            var result = archivist.Rethink(document);

            Assert.Null(result);
            archivistMock.Verify(it => it.Rethink(document), Times.Once);
        }