Пример #1
0
        public void CompleteRecuitmentShouldChangeGameStatusToFinished()
        {
            var game = new Recruitment {
                Status = GameStatus.Started
            };
            var repo = new Mock <IDeletableEntityRepository <Recruitment> >();

            repo.Setup(x => x.GetByIdAsync(It.IsAny <string>())).Returns(Task.FromResult(game));
            var userRecruitRepo = new Mock <IDeletableEntityRepository <RecruitmentUser> >();
            var userRepo        = new Mock <IDeletableEntityRepository <User> >();
            var service         = new RecruitmentService(repo.Object, userRecruitRepo.Object, userRepo.Object);

            service.CompleteAsync("70400fb3-aed2-4876-aa9a-bcf8ba49ca9f").GetAwaiter().GetResult();

            Assert.Equal(GameStatus.Finished, game.Status);
        }