Exemplo n.º 1
0
        public void AddComment(string encounterId, string comment)
        {
            User      user = userRepo.Get(loginServices.LoggedUser.UserName);
            Encounter encounterToComment = TryToGetEncounter(encounterId);

            encounterToComment.AddComment(user, comment);
            encounterRepository.Update(encounterToComment);
        }
Exemplo n.º 2
0
        private Encounter CreateTombaRiverEncounter()
        {
            Encounter encounter = new Encounter(football, new List <Team>()
            {
                tomba, river
            }, new DateTime(3000, 10, 5));

            encounter.AddComment(macri, "Meow");
            return(encounter);
        }
        private Encounter CreateBocaRiverEncounter()
        {
            Encounter encounter = new Encounter(futbol, new List <Team>()
            {
                boca, river
            }, new DateTime(3001, 10, 10));

            encounter.AddComment(macri, "Meow");
            encounter.AddOrReplaceResult(boca, 1);
            encounter.AddOrReplaceResult(river, 2);
            return(encounter);
        }
Exemplo n.º 4
0
        public void AddMessageTest()
        {
            User      user      = new User("User");
            Encounter encounter = new Encounter(futbol, teams, fechaMenor);

            encounter.AddComment(user, "msj");

            Comment comment = encounter.Comments.Single();

            Assert.AreEqual(user, comment.User);
            Assert.AreEqual("msj", comment.Message);
            Assert.AreEqual(DateTime.Now.Hour, comment.TimeStamp.Hour);
        }
        public void UpdateEncounterTest()
        {
            Encounter encounter = repo.GetAll().First(e => e.Teams.Contains(boca));

            encounter.AddComment(macri, "msj");
            encounter.AddOrReplaceResult(river, 2);
            repo.Update(encounter);

            Encounter updated = repo.GetAll().First(e => e.Teams.Contains(boca));

            Assert.IsTrue(updated.Comments.Any(c => c.Message.Equals("msj")));
            Assert.IsTrue(updated.Results.Any(p => p.Key.Equals(river) && p.Value.Equals(2)));
        }