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); }
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; }