public void GetCommentsTest()
        {
            Commentary  dummy = BuildFakeCommentary();
            Mock <Team> home  = new Mock <Team>(3, "Manchester United", "aPath", sport);
            Mock <Team> away  = new Mock <Team>(5, "Real Madrid", "aPath", sport);
            Match       match = new Match(3, new List <Team>()
            {
                home.Object, away.Object
            }, DateTime.Now, sport);

            matchesStorage.Add(match);
            matchesStorage.CommentOnEncounter(3, dummy);

            ICollection <Commentary> allComments = matchesStorage.GetComments();

            Assert.AreEqual(1, allComments.Count);
        }
Пример #2
0
 private Commentary AddComment(int encounterId, Commentary toAdd)
 {
     try
     {
         return(encountersStorage.CommentOnEncounter(encounterId, toAdd));
     }
     catch (EncounterNotFoundException e)
     {
         throw new ServiceException(e.Message, ErrorType.ENTITY_NOT_FOUND);
     }
     catch (DataInaccessibleException e) {
         throw new ServiceException(e.Message, ErrorType.DATA_INACCESSIBLE);
     }
 }