public void SutIsProductRepository(AuditingProductRepository sut)
 {
     // Fixture setup
     // Exercise system
     // Verify outcome
     Assert.IsAssignableFrom<ProductRepository>(sut);
     // Teardown
 }
 public void InsertProductWillAuditInsertion(Product product, [Frozen]Mock<IAuditor> auditorMock, AuditingProductRepository sut)
 {
     // Fixture setup
     // Exercise system
     sut.InsertProduct(product);
     // Verify outcome
     auditorMock.Verify(a => a.Record(It.Is<AuditEvent>(ae => ae.Name == "ProductInserted" && ae.Data.Equals(product))));
     // Teardown
 }
 public void InsertProductWillInsertProductInDecoratedRepository(Product product, [Frozen]Mock<ProductRepository> repositoryMock, AuditingProductRepository sut)
 {
     // Fixture setup
     // Exercise system
     sut.InsertProduct(product);
     // Verify outcome
     repositoryMock.Verify(r => r.InsertProduct(product));
     // Teardown
 }
 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
 }
        public IProductManagementService ResolveProductManagementService()
        {
            string connectionString =
                ConfigurationManager.ConnectionStrings
                ["CommerceObjectContext"].ConnectionString;

            ProductRepository sqlRepository =
                new SqlProductRepository(connectionString);

            IAuditor sqlAuditor =
                new SqlAuditor(connectionString);

            ProductRepository auditingRepository =
                new AuditingProductRepository(
                    sqlRepository, sqlAuditor);

            IContractMapper mapper = new ContractMapper();

            return new ProductManagementService(
                auditingRepository, mapper);
        }