示例#1
0
        public void MakeSureICanGetPoemByID()
        {
            //Arrange
            PoemRepository repo = new PoemRepository(mock_context.Object);

            //Act
            int  myId         = 102;
            Poem found_poetry = repo.FindPoemById(myId);

            List <Poem> my_poetry = repo.GetPoems();

            Assert.IsTrue(my_poetry.Contains(found_poetry));
        }
示例#2
0
        // GET api/<controller>/5
        public Poem Get(int id)
        {
            Poem foundPoem = repo.FindPoemById(id);

            return(foundPoem);
        }