Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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));
        }