public void BusinessBaseFactory_Can_Save_Existing_Object()
        {
            BusinessBaseServerFactory<Product> _factory = new BusinessBaseServerFactory<Product>(_repository);

            Product product = Product.GetOldProduct();
            product.Name = "Updated Data";
            _factory.Update(product);

            _repository.AssertWasCalled(x => x.Update(product));
            unitOfWorkStub.AssertWasCalled(x => x.TransactionalFlush());
        }
        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_Update_DeletedObject_Calls_Delete()
        {
            BusinessBaseServerFactory<Product> _factory = new BusinessBaseServerFactory<Product>(_repository);

            Product product = Product.GetOldProduct();
            product.MarkDeleted();
            _factory.Update(product);

            _repository.AssertWasCalled(x => x.Delete(product));
            unitOfWorkStub.AssertWasCalled(x => x.TransactionalFlush());
        }