public async Task EditFireplace_WithNonExistingFireplace_ShouldThrowException()
        {
            // Arrange
            var context = ApplicationDbContextInMemoryFactory.InitializeContext();

            var groupRepository        = new EfDeletableEntityRepository <Product_Group>(context);
            var productRepository      = new EfDeletableEntityRepository <Product>(context);
            var fireplacesRepository   = new EfDeletableEntityRepository <Fireplace_chamber>(context);
            var suggestItemsReposotory = new EfDeletableEntityRepository <SuggestProduct>(context);

            var groupService   = new GroupService(groupRepository);
            var prodcutService = new ProductService(productRepository, groupService);
            var sugestItemsRepositoryService = new SuggestProdcut(suggestItemsReposotory);
            var cloudinaryService            = new FakeCloudinary();
            var fireplaceService             = new FireplaceService(fireplacesRepository, groupService, prodcutService, cloudinaryService, sugestItemsRepositoryService);

            var user = new ApplicationUser
            {
                Id             = "abc",
                FirstName      = "Nikolay",
                LastName       = "Doychev",
                Email          = "*****@*****.**",
                EmailConfirmed = true,
            };

            var       fileName = "Img";
            IFormFile file     = new FormFile(
                new MemoryStream(Encoding.UTF8.GetBytes("This is a dummy file")),
                0,
                0,
                fileName,
                "dummy.png");

            var fireplace = new EditFireplaceViewModel
            {
                Id            = "Test Id",
                Power         = "10w",
                Chimney       = "200Ф",
                Description   = "Some description test 1",
                ImagePath     = file,
                Price         = 1800.00M,
                Size          = "60 / 40 / h50",
                TypeOfChamber = TypeOfChamber.Basic.ToString(),
                Name          = "Гк Мая сменено",
            };

            var seeder = new DbContextTestsSeeder();
            await seeder.SeedUsersAsync(context);

            await seeder.SeedGroupAsync(context);

            await seeder.SeedProdcutAsync(context);

            await seeder.SeedFireplacesAsync(context);

            // Act
            AutoMapperConfig.RegisterMappings(typeof(FireplaceInputModel).Assembly);
            await Assert.ThrowsAsync <NullReferenceException>(() => fireplaceService.EditAsync <EditFireplaceViewModel>(fireplace));
        }
        public async Task EditFireplace_WithCorrectData_ShouldSuccessfullyEdit()
        {
            // Arrange
            var context = ApplicationDbContextInMemoryFactory.InitializeContext();

            var groupRepository        = new EfDeletableEntityRepository <Product_Group>(context);
            var productRepository      = new EfDeletableEntityRepository <Product>(context);
            var fireplacesRepository   = new EfDeletableEntityRepository <Fireplace_chamber>(context);
            var suggestItemsReposotory = new EfDeletableEntityRepository <SuggestProduct>(context);

            var groupService   = new GroupService(groupRepository);
            var prodcutService = new ProductService(productRepository, groupService);
            var sugestItemsRepositoryService = new SuggestProdcut(suggestItemsReposotory);
            var cloudinaryService            = new FakeCloudinary();
            var fireplaceService             = new FireplaceService(fireplacesRepository, groupService, prodcutService, cloudinaryService, sugestItemsRepositoryService);

            var user = new ApplicationUser
            {
                Id             = "abc",
                FirstName      = "Nikolay",
                LastName       = "Doychev",
                Email          = "*****@*****.**",
                EmailConfirmed = true,
            };

            var       fileName = "Img";
            IFormFile file     = new FormFile(
                new MemoryStream(Encoding.UTF8.GetBytes("This is a dummy file")),
                0,
                0,
                fileName,
                "dummy.png");

            var fireplace = new EditFireplaceViewModel
            {
                Id            = "abc1",
                Power         = "10w",
                Chimney       = "200Ф",
                Description   = "Some description test 1",
                ImagePath     = file,
                Price         = 1800.00M,
                Size          = "60 / 40 / h50",
                TypeOfChamber = TypeOfChamber.Basic.ToString(),
                Name          = "Гк Мая сменено",
            };

            var seeder = new DbContextTestsSeeder();
            await seeder.SeedUsersAsync(context);

            await seeder.SeedGroupAsync(context);

            await seeder.SeedProdcutAsync(context);

            await seeder.SeedFireplacesAsync(context);

            // Act
            AutoMapperConfig.RegisterMappings(typeof(EditFireplaceViewModel).Assembly);
            var result = await fireplaceService.EditAsync <EditFireplaceViewModel>(fireplace);

            var actual = context.Fireplace_Chambers.FirstOrDefault(x => x.Product.Name == "Гк Мая сменено");

            var expectedName          = "Гк Мая сменено";
            var expectedPower         = "10w";
            var expectedChimney       = "200Ф";
            var expectedPrice         = 1800.00M;
            var expectedSize          = "60 / 40 / h50";
            var expectedTypeOfChamber = TypeOfChamber.Basic.ToString();

            // Assert
            AssertExtension.EqualsWithMessage(expectedName, actual.Product.Name, string.Format(ErrorMessage, "AddFireplace returns correct Name"));
            AssertExtension.EqualsWithMessage(expectedPower, actual.Power, string.Format(ErrorMessage, "AddFireplace returns correct Power"));
            AssertExtension.EqualsWithMessage(expectedChimney, actual.Chimney, string.Format(ErrorMessage, "AddFireplace returns correct Chimney"));
            Assert.Equal(expectedPrice, actual.Price);
            AssertExtension.EqualsWithMessage(expectedSize, actual.Size, string.Format(ErrorMessage, "AddFireplace returns correct Size"));
            AssertExtension.EqualsWithMessage(expectedTypeOfChamber, actual.TypeOfChamber.ToString(), string.Format(ErrorMessage, "AddFireplace returns correct TypeOfChamber"));
        }