public async Task TestIfGetMainSliderPicturesThrowsError()
        {
            var context = PCHUBDbContextInMemoryInitializer.InitializeContext();


            var adminPageService = new Areas.Administration.Services.AdminIndexPageServices(context);

            await Assert.ThrowsAsync <NullReferenceException>(async() =>
            {
                await adminPageService.GetMainSliderPicturesAsync();
            });
        }
        public async Task TestIfEditMainSliderPicturesWorksAccordingly()
        {
            var context = PCHUBDbContextInMemoryInitializer.InitializeContext();

            var adminPageService = new Areas.Administration.Services.AdminIndexPageServices(context);

            var testUrls = new List <string>
            {
                "TestUrl1",
                "TestUrl2",
                "RandomTestUrl",
            };

            await adminPageService.UploadMainSliderPicturesAsync(testUrls);

            var mainSlider = await context.MainSliders.FirstOrDefaultAsync(x => x.Name == "MainSlider");

            var pictureIds = mainSlider.MainSliderPictures.Select(x => x.Id);

            var form = new List <EditMainSliderPictures>();

            foreach (var id in pictureIds)
            {
                form.Add(new EditMainSliderPictures
                {
                    Url       = "Url",
                    Name      = "Name",
                    IsDeleted = false,
                    Id        = id
                });
            }

            await adminPageService.EditMainSliderPicturesAsync(form);

            var result = await adminPageService.GetMainSliderPicturesAsync();

            Assert.NotEmpty(result);

            foreach (var resultPic in result)
            {
                Assert.Equal("Url", resultPic.Url);
                Assert.Equal("Name", resultPic.Name);
            }
        }
        public async Task TestIfGetMainSliderPicturesWorksAccordingly()
        {
            var context = PCHUBDbContextInMemoryInitializer.InitializeContext();

            var testUrls = new List <string>
            {
                "TestUrl1",
                "TestUrl2",
                "RandomTestUrl",
            };

            var adminPageService = new Areas.Administration.Services.AdminIndexPageServices(context);


            await adminPageService.UploadMainSliderPicturesAsync(testUrls);

            var result = await adminPageService.GetMainSliderPicturesAsync();

            Assert.NotEmpty(result);

            Assert.Contains(result, pic => pic.Url == "TestUrl1");
        }