// Person public void RegisterPerson(Person person) { using (var db = new OCCDB()) { var pTo = new OCC.Data.Person(); Mapper.CopyProperties(person, pTo); //TODO OFC - Uncomment persistence calls // db.People.Add(pTo); // db.SaveChanges(); } }
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 }