public void Remove_Gets_Removed() { var newFermentable = new Fermentable { Name = "newFermentable" + DateTime.Now.Ticks, Type = "Grain", Custom = true }; _fermentableRepository.Add(newFermentable); _fermentableRepository.Remove(newFermentable); var fermentables = _fermentableRepository.GetAll(); Assert.True(fermentables.All(o => o.FermentableId != newFermentable.FermentableId)); }
public IActionResult Remove(string oid) { var fermentable = _fermentableRepository.Find(x => x.Oid == new Guid(oid)); if (fermentable == null) { return(NotFound()); } _fermentableRepository.Remove(fermentable); return(Ok()); }