Example #1
0
        public void CelsiusToFahrenheit()
        {
            var result = new ApiFactory()
                         .ChangeContext <ICelsiusToFahrenheit>()
                         .ClickOnTemperatureConvector()
                         .ClickOnCelsius()
                         .ClickOnCelsiusToFahrenheit()
                         .TypeToCelsiusTextBox(numberToConvert)
                         .ChangeFormatToDecimal()
                         .GetConvertionValue();

            var actual   = result.GetResaultNum();
            var num      = ConversionRaitasCalcluation.CelsiusToFahrenheit(numberToConvert);
            var expected = Math.Abs(actual - num);

            Assert.IsTrue(expected < 1);
        }
        public void CelsiusToFahrenheit()
        {
            var resultFromUi = apiFactory
                               .ChangeContext <ICelsiusToFahrenheit>()
                               .ClickOnTemperatureConvector()
                               .ClickOnCelsius()
                               .ClickOnCelsiusToFahrenheit()
                               .TypeToCelsiusTextBox(numberToConvert)
                               .ChangeFormatToDecimal()
                               .GetConvertionValue();

            var resultFromCalcuation = ConversionRaitasCalcluation.CelsiusToFahrenheit(numberToConvert);
            var expected             = Math.Abs(resultFromUi - resultFromCalcuation);

            Assert.IsTrue(expected < 1);

            driver.Quit();
            driver = null;
        }