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

            var groupRepository      = new EfDeletableEntityRepository <Product_Group>(context);
            var productRepository    = new EfDeletableEntityRepository <Product>(context);
            var accessorieRepository = new EfDeletableEntityRepository <Accessorie>(context);

            var groupService      = new GroupService(groupRepository);
            var prodcutService    = new ProductService(productRepository, groupService);
            var cloudinaryService = new FakeCloudinary();
            var accessorieService = new AccessoriesService(accessorieRepository, prodcutService, groupService, cloudinaryService);

            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 accessorie = new EditAccessorieViewModel
            {
                Id          = "abc1",
                Description = "Some description test 1",
                ImagePath   = file,
                Name        = "Аксесоар 1 сменено",
            };

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

            await seeder.SeedGroupAsync(context);

            await seeder.SeedAccessorieAsync(context);

            // Act
            AutoMapperConfig.RegisterMappings(typeof(EditAccessorieViewModel).Assembly);
            var result = await accessorieService.EditAsync <EditAccessorieViewModel>(accessorie);

            var actual = context.Accessories.FirstOrDefault(x => x.Product.Name == "Аксесоар 1 сменено");

            var expectedName        = "Аксесоар 1 сменено";
            var expectedDescription = "Some description test 1";

            // Assert
            AssertExtension.EqualsWithMessage(expectedName, actual.Product.Name, string.Format(ErrorMessage, "EditAccessorie returns correct Name"));
            AssertExtension.EqualsWithMessage(expectedDescription, actual.Description, string.Format(ErrorMessage, "EditAccessorie returns correct Description"));
        }
        public async Task EditAccessorie_WithNonExistingAccessorie_ShouldThrowException()
        {
            // Arrange
            var context = ApplicationDbContextInMemoryFactory.InitializeContext();

            var groupRepository      = new EfDeletableEntityRepository <Product_Group>(context);
            var productRepository    = new EfDeletableEntityRepository <Product>(context);
            var accessorieRepository = new EfDeletableEntityRepository <Accessorie>(context);

            var groupService      = new GroupService(groupRepository);
            var prodcutService    = new ProductService(productRepository, groupService);
            var cloudinaryService = new FakeCloudinary();
            var accessorieService = new AccessoriesService(accessorieRepository, prodcutService, groupService, cloudinaryService);

            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 accessorie = new EditAccessorieViewModel
            {
                Id          = "Test Id",
                Description = "Some description test 1",
                Name        = "Аксесоар 1",
                ImagePath   = file,
            };

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

            await seeder.SeedGroupAsync(context);

            await seeder.SeedProjectAsync(context);

            // Act
            AutoMapperConfig.RegisterMappings(typeof(EditAccessorieViewModel).Assembly);
            await Assert.ThrowsAsync <NullReferenceException>(() => accessorieService.EditAsync <EditAccessorieViewModel>(accessorie));
        }