public async Task TestCreateAndUpdateRules()
        {
            var mockRuleRepository         = new Mock <IClothingRuleRepository>();
            var mockWeatherForecastService = new Mock <IWeatherForecastService>();

            mockRuleRepository.Setup(rr => rr.Create(It.IsAny <ClothingRule>())).ReturnsAsync(1);
            var service     = new ClothingRecommendationService(mockWeatherForecastService.Object, mockRuleRepository.Object);
            var id          = "b5b6c634-bc43-4c41-8d90-74c05c5567df";
            var newrule     = new ClothingRule(150, 350, true, "BurnFeelsSoGood", new Guid(id));
            var ruleCreated = await service.CreateRule(newrule);

            Assert.IsTrue(ruleCreated);
            mockRuleRepository.Setup(rr => rr.Update(It.IsAny <ClothingRule>())).ReturnsAsync(1);
            mockRuleRepository.Verify(rr => rr.Update(It.Is <ClothingRule>(c => c.Clothes == "BurnFeelsSoGood")));


            var ruleUpdate  = new ClothingRule(160, 370, true, "AllTheBurns", new Guid(id));
            var ruleUpdated = await service.UpdateRule(ruleUpdate);

            Assert.IsTrue(ruleUpdated);
            var wantedtemp = 160;

            mockRuleRepository.Verify(rr => rr.Update(It.Is <ClothingRule>(c => c.Clothes == "AllTheBurns" && c.Id == new Guid(id))));
            mockRuleRepository.Verify(rr => rr.Update(It.Is <ClothingRule>(c => c.FromTemperature == wantedtemp)));
        }
        public async Task TestInvalid()
        {
            var mockRuleRepository = new Mock <IClothingRuleRepository>();
            var mockWeatherServce  = new Mock <IWeatherForecastService>();

            mockRuleRepository.Setup(rr => rr.Create(It.IsAny <ClothingRule>())).ReturnsAsync(1);
            var invalidrule = new ClothingRule(-100000000, -0, null, null, null);
            var service     = new ClothingRecommendationService(mockWeatherServce.Object, mockRuleRepository.Object);
            var isCreated   = await service.CreateRule(invalidrule);

            Assert.IsFalse(isCreated);
        }
        public async Task TestCreateRule()
        {
            var mockRuleRepository         = new Mock <IClothingRuleRepository>();
            var mockWeatherForecastService = new Mock <IWeatherForecastService>();


            mockRuleRepository.Setup(rr => rr.Create(It.IsAny <ClothingRule>())).ReturnsAsync(1);
            var service = new ClothingRecommendationService(mockWeatherForecastService.Object, mockRuleRepository.Object);
            var newRule = new ClothingRule(100, 200, false, "bærepose");

            var ruleCreated = await service.CreateRule(newRule);

            Assert.IsTrue(ruleCreated);
            mockRuleRepository.Verify(rr => rr.Create(It.Is <ClothingRule>(c => c.Clothes == "bærepose" && c.IsRaining == false)));
        }