public void Returnupdate() { var mock = new Mock <IBookService>(); update up = new update(); up.Id = 123; up.BookName = "aaa"; mock.Setup(repo => repo.Update(up)).Returns(true); test = new testbook(mock.Object); Assert.True(test.Testupdate(up)); }
public void Returnadd() { var mock = new Mock <IBookService>(); adds add = new adds(); add.BookName = "aaa"; add.Author = "bbb"; mock.Setup(repo => repo.Add(add)).Returns(true); test = new testbook(mock.Object); Assert.True(test.Testadd(add)); }