public void TestGetByDocumentFailsOnMissingFooter()
        {
            Mock <IFooterRepository>   mockFooterRepository   = new Mock <IFooterRepository>();
            Mock <IDocumentRepository> mockDocumentRepository = new Mock <IDocumentRepository>();
            IFooterManagementService   footerLogic            = new FooterManagementService
            {
                FooterRepository   = mockFooterRepository.Object,
                DocumentRepository = mockDocumentRepository.Object
            };
            Document fakeDocument = GetFakeDocument();
            Footer   fakeFooter   = GetFakeFooterForDocument(fakeDocument);


            mockDocumentRepository
            .Setup(wl => wl.Exists(fakeDocument.Id))
            .Returns(true);
            mockFooterRepository
            .Setup(wl => wl.ExistsForDocument(fakeDocument.Id))
            .Returns(false);

            Footer result = footerLogic.GetByDocument(fakeDocument.Id);

            mockDocumentRepository.VerifyAll();
            mockFooterRepository.VerifyAll();
        }
        public void TestGetByDocumentReturnsFooterOnExistingFooterAndDocument()
        {
            Mock <IFooterRepository>   mockFooterRepository   = new Mock <IFooterRepository>();
            Mock <IDocumentRepository> mockDocumentRepository = new Mock <IDocumentRepository>();
            IFooterManagementService   footerLogic            = new FooterManagementService
            {
                FooterRepository   = mockFooterRepository.Object,
                DocumentRepository = mockDocumentRepository.Object
            };
            Document fakeDocument = GetFakeDocument();
            Footer   fakeFooter   = GetFakeFooterForDocument(fakeDocument);


            mockDocumentRepository
            .Setup(wl => wl.Exists(fakeDocument.Id))
            .Returns(true);
            mockFooterRepository
            .Setup(wl => wl.ExistsForDocument(fakeDocument.Id))
            .Returns(true);
            mockFooterRepository
            .Setup(wl => wl.GetByDocument(fakeDocument.Id))
            .Returns(fakeFooter);

            Footer result = footerLogic.GetByDocument(fakeDocument.Id);

            mockDocumentRepository.VerifyAll();
            mockFooterRepository.VerifyAll();
            Assert.IsNotNull(result);
            Assert.AreEqual(result, fakeFooter);
        }