public void reading_is_persisted_correctly()
        {
            using (var scope = new SessionScope(factory))
            {
                var readings = new MessagesForContestant {
                    Contest = contest, Contestant = isenbaev
                }
                .List(scope.Session);
                Assert.True(readings.All(x => !x.IsRead));

                var answerReading = readings.Single(x => x.Message is Answer);
                Assert.False(answerReading.IsRead);

                answerReading.IsRead = true;
                scope.Session.Save(answerReading);
            }

            using (var scope = new SessionScope(factory))
            {
                var readings = new MessagesForContestant {
                    Contest = contest, Contestant = isenbaev
                }
                .List(scope.Session);

                var answerReading = readings.Single(x => x.Message is Answer);
                Assert.True(answerReading.IsRead);
            }
        }
 public void contestant_should_receive_announcements_clarifications_and_answers()
 {
     using (var scope = new SessionScope(factory))
     {
         var readings = new MessagesForContestant {
             Contest = contest, Contestant = isenbaev
         }
         .List(scope.Session);
         var msgs = readings.Select(x => x.Message);
         Assert.NotEmpty(msgs.OfType <Clarification>());
         Assert.NotEmpty(msgs.OfType <Announcement>());
         Assert.Equal(1, msgs.OfType <Question>().Count());
         Assert.Equal(1, msgs.OfType <Answer>().Count());
     }
 }