public async Task Test_Decline_Mission()
        {
            var oldUser        = (await _userService.GetUser("User1Id")).Copy();
            var firstMissionId = oldUser.ActiveMissionIds.First().MissionId;
            var declineResult  = await _controller.DeclineMission(firstMissionId);

            var user = await _userService.GetUser("User1Id");

            Assert.AreEqual(OperationResultStatus.Success, declineResult.Status);
            Assert.Less(user.Points, oldUser.Points);
            Assert.False(user.ActiveMissionIds.Select(m => m.MissionId).Contains(firstMissionId));
            Assert.Contains(firstMissionId, user.FailedMissionIds);
            if (user.Level != 0 || user.Points != 0)
            {
                Assert.Less(user.Points, oldUser.Points);
            }
        }
示例#2
0
        public async Task Censored_Success()
        {
            var user = await _userRepository.GetUser("User1Id");

            var oldPoints = user.Points;

            var result = await _controller.DeclineMission("524b9f98-88b2-460a-ae3f-e15df4cef2ae");

            user = await _userRepository.GetUser("User1Id");

            Assert.AreEqual(result.Status, OperationResultStatus.Success);
            Assert.AreEqual(result.MissionCompletionStatus, MissionCompletionStatus.Success);
            Assert.Greater(user.Points, oldPoints);
        }