Exemplo n.º 1
0
        public void IsSimpleImagePercentageCalculationCorrect()
        {
            //Arrange
            Bitmap bmp = new Bitmap(@"../../TestData/Glass1.bmp");
            ICalculateLiquidPercentage simga = new SimpleImageAnalysis(bmp);

            //Act
            var percentage = simga.CalculatePercentageOfLiquid();

            //Assert
            Assert.AreEqual(percentage, 62);
        }
Exemplo n.º 2
0
        public async Task GetGlassInformation(Bitmap bitmap)
        {
            GooglePlacesApiData     googleApiData = new GooglePlacesApiData();
            GooglePlacesApiResponse responseData  = await googleApiData.GetApiResponseData("food");

            SimpleImageAnalysis imageInformation = new SimpleImageAnalysis(bitmap);
            int percentageOfLiquid = imageInformation.CalculatePercentageOfLiquid();

            Date       = DateTime.Today;
            Name       = responseData.results[0].name;
            Address    = responseData.results[0].vicinity;
            Percentage = percentageOfLiquid;
        }