Exemplo n.º 1
0
 public static Event InsertEvent(InMemoryOCCDB context, string name)
 {
     var item = new Event
     {
         Name = name
     };
     context.Events.Add(item);
     return item;
 }
Exemplo n.º 2
0
        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
        }