public void DeleteProductWillAuditDeletion(int id, [Frozen]Mock<IAuditor> auditorMock, AuditingProductRepository sut) { // Fixture setup // Exercise system sut.DeleteProduct(id); // Verify outcome auditorMock.Verify(a => a.Record(It.Is<AuditEvent>(ae => ae.Name == "ProductDeleted" && ae.Data.Equals(id)))); // Teardown }
public void DeleteProductWillDeleteProductFromDecoratedRepository(int id, [Frozen]Mock<ProductRepository> repositoryMock, AuditingProductRepository sut) { // Fixture setup // Exercise system sut.DeleteProduct(id); // Verify outcome repositoryMock.Verify(r => r.DeleteProduct(id)); // Teardown }