public async Task Return_Correct_Contest()
        {
            var options = Utils.GetOptions(nameof(Return_Correct_Contest));

            var categoryService = new Mock <ICategoryService>().Object;
            var userService     = new Mock <IUserService>().Object;
            var userStore       = new Mock <IUserStore <User> >();
            var userManager     = new Mock <UserManager <User> >(userStore.Object, null, null, null,
                                                                 null, null, null, null, null).Object;
            var contextAccessor      = new Mock <IHttpContextAccessor>().Object;
            var userPrincipalFactory = new Mock <IUserClaimsPrincipalFactory <User> >().Object;
            var signManager          = new Mock <SignInManager <User> >(userManager, contextAccessor, userPrincipalFactory, null, null, null, null).Object;

            using (var arrContext = new PhotoContestContext(options))
            {
                await arrContext.Statuses.AddRangeAsync(Utils.SeedStatuses());

                await arrContext.Categories.AddRangeAsync(Utils.SeedCategories());

                await arrContext.Contests.AddRangeAsync(Utils.SeedContests());

                await arrContext.SaveChangesAsync();
            }
            using (var actContext = new PhotoContestContext(options))
            {
                var sut    = new ContestService(actContext, contextAccessor, userService, categoryService, userManager, signManager);
                var result = await sut.FindContestByNameAsync(actContext.Contests.First().Name);

                Assert.AreEqual(result.Id, actContext.Contests.First().Id);
                Assert.AreEqual(result.Name, actContext.Contests.First().Name);
                Assert.AreSame(result, actContext.Contests.First());
            }
        }
        public async Task ThrowsWhen_Contest_NotFound()
        {
            var options = Utils.GetOptions(nameof(ThrowsWhen_Contest_NotFound));

            var categoryService = new Mock <ICategoryService>().Object;
            var userService     = new Mock <IUserService>().Object;
            var userStore       = new Mock <IUserStore <User> >();
            var userManager     = new Mock <UserManager <User> >(userStore.Object, null, null, null,
                                                                 null, null, null, null, null).Object;
            var contextAccessor      = new Mock <IHttpContextAccessor>().Object;
            var userPrincipalFactory = new Mock <IUserClaimsPrincipalFactory <User> >().Object;
            var signManager          = new Mock <SignInManager <User> >(userManager, contextAccessor, userPrincipalFactory, null, null, null, null).Object;

            using (var actContext = new PhotoContestContext(options))
            {
                var sut = new ContestService(actContext, contextAccessor, userService, categoryService, userManager, signManager);
                await Assert.ThrowsExceptionAsync <ArgumentException>(() => sut.FindContestByNameAsync("wrong"));
            }
        }