public void RegisterGroceriesCommandHandlerShouldntReturnNotifications() { var _mock = MockRepository.GenerateMock <IGroceriesRepository>(); var command = new RegisterGroceriesCommand() { Name = "TestGrocery", Price = 10, Unity = Enums.Unity.Liters, Category = Enums.Category.BakingGoods }; RegisterGroceriesCommandHandler handler = new RegisterGroceriesCommandHandler(_mock); var g = handler.Handle(command); Assert.AreEqual(handler.Notifications.Count, 0); }
public async Task <IActionResult> Post([FromBody] RegisterGroceriesCommand command) { var result = _registerGroceriesCommandHandler.Handle(command); return(await Response(result, _registerGroceriesCommandHandler.Notifications)); }