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