public void BusinessBaseFactory_Can_Create_Object() { BusinessBaseServerFactory<Product> _factory = new BusinessBaseServerFactory<Product>(_repository); Product product = _factory.Create(); Assert.IsNotNull(product); }
public void BusinessBaseFactory_Can_Save_New_Object() { BusinessBaseServerFactory<Product> _factory = new BusinessBaseServerFactory<Product>(_repository); Product product = _factory.Create(); product.Name = "Test 123"; _factory.Update(product); _repository.AssertWasCalled(x => x.Save(product)); unitOfWorkStub.AssertWasCalled(x => x.TransactionalFlush()); }
public void BusinessBaseFactory_Fetch_WithNull_Critiria_Throws() { BusinessBaseServerFactory<Product> _factory = new BusinessBaseServerFactory<Product>(_repository); Product product = _factory.Create(); product = _factory.Fetch(null); }
public void BusinessBaseFactory_Fetch_WithCriteria_ReturnsObject() { BusinessBaseServerFactory<Product> _factory = new BusinessBaseServerFactory<Product>(_repository); Product product = _factory.Create(); product = _factory.Fetch(new SingleCriteria<Product, int>(32)); _repository.AssertWasCalled(x => x.Load(product, 32)); }