public void Delete_works_Properly() { string errorMessagePrefix = "ReceiverService Delete() method does not work properly."; var context = OilsProDbContextInMemoryFactory.InitializeContext(); this.receiverService = new ReceiverService(context); var receiver = new Receiver { Name = "Receiver1", }; context.Receivers.Add(receiver); context.SaveChanges(); var result = receiverService.Delete(receiver.Id); Assert.True(result.isDeleted); }
public IActionResult Delete(string id) { var receiver = _receiversService.Delete(id); return(this.Redirect("/Nomenclatures/Receivers")); }