public static Person InsertPerson(InMemoryOCCDB context, string firstName, string lastName) { var item = new Person { FirstName = firstName, LastName = lastName }; context.People.Add(item); return item; }
public void WhenGettingSessionPropertiesAreRetrievedCorrectly() { // Assemble var dbContext = new InMemoryOCCDB() .WithEvent("Test Code Camp") .WithPerson("Test", "Speaker"); _expectedEvent = dbContext.Events.First(); _expectedSpeaker = dbContext.People.First(); _expectedSession = new Data.Session { Description = "This is the event", Event_ID = _expectedEvent.ID, Level = 300, Location = "The really far building", Name = "Best .NET Session", Speaker_ID = _expectedSpeaker.ID, Status = "Still Happening", }; dbContext.Sessions.Add(_expectedSession); dbContext.SaveChanges(); var service = TestHelper.GetTestService(dbContext); // Act _actualSession = service.GetSession(_expectedSession.ID); // Assert }