public void TestShouldCreateProduct() { // Arrange _repository.AddProduct(SampleProducts.CreateProduct()) .ReturnsForAnyArgs(SampleProducts.CreateProduct(1)); var sut = CreateProductInteractor(); // Act var result = sut.CreateProduct("FirstProduct", "This is the first product."); // Assert Assert.AreEqual(1, result.Id); Assert.AreEqual("This is the first product.", result.Description); }
/// <summary> /// Create a new product. /// </summary> public Product CreateProduct(string name, string description = "") { var product = ProductFactory.CreateProduct(name, description); return(_commands.AddProduct(product)); }