public void UpdateProductWillAuditEvent(Product product, [Frozen]Mock<IAuditor> auditorMock, AuditingProductRepository sut) { // Fixture setup // Exercise system sut.UpdateProduct(product); // Verify outcome auditorMock.Verify(a => a.Record(It.Is<AuditEvent>(ae => ae.Name == "ProductUpdated" && ae.Data.Equals(product)))); // Teardown }
public void UpdateProductWillUpdateProductInDecoratedRepository(Product product, [Frozen]Mock<ProductRepository> repositoryMock, AuditingProductRepository sut) { // Fixture setup // Exercise system sut.UpdateProduct(product); // Verify outcome repositoryMock.Verify(r => r.UpdateProduct(product)); // Teardown }