[InlineData("cktan", "Fragrant Garlic", "Fragrant Garlic (Small)", "Spice", 1.50, 100.0, "g", -1)] // stock
        public async Task Create_plant_details_bad_request_reponse(string userId, string name, string description, string category, decimal price, decimal weight, string unit, int stock)
        {
            //Arrange
            var plantDetailsContext = new PlantListingContext(_dbOptions);

            var invalidCreatePlantDetailsViewModel = new CreateEditPlantDetailsViewModel()
            {
                PlantDetailsId = 0,
                Name           = name,
                Description    = description,
                Category       = category,
                Price          = price,
                Weight         = weight,
                Unit           = unit,
                Stock          = stock,
                UserId         = userId
            };

            //Act
            var plantDetailsController = new PlantListingController(plantDetailsContext, _mockPlantImageService.Object);
            var actionResult           = await plantDetailsController.CreatePlantDetails(invalidCreatePlantDetailsViewModel);

            //Assert
            Assert.IsType <BadRequestResult>(actionResult.Result);
        }
        public async Task Create_plant_details_success()
        {
            //Arrange
            var plantDetailsContext = new PlantListingContext(_dbOptions);

            var userId = "cktan";
            var validCreatePlantDetailsViewModel = new CreateEditPlantDetailsViewModel()
            {
                Name        = "Bean sprouts",
                Description = "Organic bean sprouts",
                Category    = "Vegetable",
                Price       = 0.80m,
                Weight      = 100.0m,
                Unit        = "g",
                Stock       = 100,
                UserId      = userId
            };

            var expectedPlantDetailsId = 9;
            var expectedName           = "Bean sprouts";
            var expectedDescription    = "Organic bean sprouts";
            var expectedCategory       = "Vegetable";
            var expectedPrice          = 0.80m;
            var expectedWeight         = 100.0m;
            var expectedUnit           = "g";
            var expectedStock          = 100;
            var expectedUserId         = "cktan";

            //Act
            var plantDetailsController = new PlantListingController(plantDetailsContext, _mockPlantImageService.Object);
            var actionResult           = await plantDetailsController.CreatePlantDetails(validCreatePlantDetailsViewModel);

            //Assert
            Assert.IsType <CreatedAtActionResult>(actionResult.Result);
            Assert.Equal("GetPlantDetails", (actionResult.Result as CreatedAtActionResult).ActionName);
            Assert.IsType <PlantDetailsViewModel>((actionResult.Result as CreatedAtActionResult).Value);

            PlantDetailsViewModel actualViewModel = (actionResult.Result as CreatedAtActionResult).Value as PlantDetailsViewModel;

            Assert.Equal(expectedPlantDetailsId, actualViewModel.PlantDetailsId);
            Assert.Equal(expectedName, actualViewModel.Name);
            Assert.Equal(expectedDescription, actualViewModel.Description);
            Assert.Equal(expectedCategory, actualViewModel.Category);
            Assert.Equal(expectedPrice, actualViewModel.Price);
            Assert.Equal(expectedWeight, actualViewModel.Weight);
            Assert.Equal(expectedUnit, actualViewModel.Unit);
            Assert.Equal(expectedStock, actualViewModel.Stock);
            Assert.Equal(expectedUserId, actualViewModel.UserId);
        }