public void TestAdd() { toppingServiceMock.Setup(m => m.GetByName("TestToppingName")) .Returns(new Topping()); sut.Add(new Pizza() { Name = "TestName" }); Assert.AreEqual(1, pizzaRepositoryMock.Invocations.Count); }
public IActionResult Create(Pizza pizza) { PizzaService.Add(pizza); return(CreatedAtAction(nameof(Create), new { id = pizza.Id }, pizza)); }