Пример #1
0
        public void DeleteHuman()
        {
            Mock <IRepository <Human> > mock3 = new Mock <IRepository <Human> >(MockBehavior.Loose);

            mock3.Setup(x => x.Delete(It.IsAny <string>()));

            HumanLogic hl = new HumanLogic(mock3.Object);
            Human      h1 = new Human()
            {
                Name = "Chad", Job = "Emperor", Nationality = "Temerian", Wage = 2000
            };

            hl.Delete(h1);

            mock3.Verify(x => x.Delete(h1), Times.Once);
        }
Пример #2
0
 public IActionResult DeleteHuman(string id)
 {
     HumanLogic.Delete(HumanLogic.Read(id));
     return(RedirectToAction(nameof(ListAllHumans)));
 }
Пример #3
0
 public void DeleteHuman(string uid)
 {
     logic.Delete(uid);
 }