Esempio n. 1
0
        public void MakeSureICanAddAPoem()
        {
            //Arrange
            PoemRepository repo    = new PoemRepository(mock_context.Object);
            Poem           newPoem = new Poem()
            {
                Title = "Test", Author = "Superman", Words = "This is that stuff right here dog"
            };

            //Act
            repo.AddPoem(newPoem);

            int numberOfPoems = repo.GetPoems().Count;

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

            //Assert
            Assert.IsTrue(myPoems.Contains(newPoem));
        }
Esempio n. 2
0
 // POST api/<controller>
 public void Post([FromBody] Poem poetry)
 {
     repo.AddPoem(poetry);
 }