public void TestDeleteHeaderWorksOnExistingHeader() { Mock <IHeaderRepository> mockHeaderRepository = new Mock <IHeaderRepository>(); Mock <IDocumentRepository> mockDocumentRepository = new Mock <IDocumentRepository>(); Mock <IContentRepository> mockContentRepository = new Mock <IContentRepository>(); Mock <IStyleClassRepository> mockStyleClassRepository = new Mock <IStyleClassRepository>(); IHeaderManagementService headerLogic = new HeaderManagementService { HeaderRepository = mockHeaderRepository.Object, DocumentRepository = mockDocumentRepository.Object, ContentRepository = mockContentRepository.Object, StyleClassRepository = mockStyleClassRepository.Object }; Document fakeDocument = GetFakeDocument(); Header fakeHeader = GetFakeHeaderForDocument(fakeDocument); mockHeaderRepository .Setup(wl => wl.Exists(fakeHeader.Id)) .Returns(true); mockHeaderRepository .Setup(wl => wl.Delete(fakeHeader.Id)); headerLogic.Delete(fakeHeader.Id); mockHeaderRepository.VerifyAll(); }