Adding speakers to the InMemory database

In order to test that the repository will return specific Speaker entities when querying the database, you first must add Speakers to the database. In order to do this, add a few lines of code to your test file:

using (var context = new SpeakerMeetContext(_options))
{
context.Speakers.Add(new Speaker { Id = 1, Name = "Test"... });
context.SaveChanges();
}

Feel free to add as many speakers as you want, with as much detail as you feel necessary. Your test should now pass. More tests can be created and should continue to be added as the system grows in functionality and complexity. The bulk of the logic should be tested already in the unit tests, but verifying that the system functions as a whole are equally important.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.208.200