Exemplo n.º 1
0
        public void GetGoalsByPlayerId()
        {
            var items = AddGoal();
            var item  = items.FirstOrDefault();

            Assert.IsNotNull(item);
            var playerId = item.PlayerId;

            var goalMgr = new GoalMgr(Context);

            //2 goals
            goalMgr.AddGoal(item.Id);
            goalMgr.AddGoal(item.Id);
            var actual = goalMgr.GetGoalsByPlayerId(playerId);

            Assert.AreEqual(2, actual.Count());
        }
Exemplo n.º 2
0
        public void GetGoalsInTheGame()
        {
            var items = AddGoal();
            var item  = items.FirstOrDefault();

            Assert.IsNotNull(item);
            var goalMgr = new GoalMgr(Context);

            //2 goals
            goalMgr.AddGoal(item.Id);
            goalMgr.AddGoal(item.Id);

            var actual = goalMgr.GetGoalsInTheGame(item.Id).ToList();

            Assert.AreEqual(2, actual.Count);

            //1 goal after remove a goal
            goalMgr.RemoveGoal(actual[0].Id);

            actual = goalMgr.GetGoalsInTheGame(item.Id).ToList();
            Assert.AreEqual(1, actual.Count);
        }