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)); }
// POST api/<controller> public void Post([FromBody] Poem poetry) { repo.AddPoem(poetry); }