Exemplo n.º 1
0
        public void TestIfDeleteInvoiceCallsDeleteInvoiceInRepo()
        {
            // Arrange

            var repo    = new Mock <IInvoiceRepository>();
            var manager = new InvoiceAccess(repo.Object);


            // Act

            manager.DeleteInvoice(It.IsAny <int>());


            // Assert

            repo.Verify(x => x.DeleteInvoice(It.IsAny <int>()), Times.Exactly(1));
        }
Exemplo n.º 2
0
        public void TestIfGetArchivedInvoicesCallsGetArchivedInvoicesInRepo()
        {
            // Arrange

            var repo    = new Mock <IInvoiceRepository>();
            var manager = new InvoiceAccess(repo.Object);


            // Act

            manager.GetArchivedInvoices();


            // Assert

            repo.Verify(x => x.GetArchivedInvoices(), Times.Exactly(1));
        }