Skip to content

Instantly share code, notes, and snippets.

@Mycoola
Last active June 15, 2023 18:19
Show Gist options
  • Save Mycoola/71b7ea2e3a46b8dde7eac5de62262946 to your computer and use it in GitHub Desktop.
Save Mycoola/71b7ea2e3a46b8dde7eac5de62262946 to your computer and use it in GitHub Desktop.
Created with Copy to Gist
@isTest
public class TemperatureConvertorTest {
@isTest static void testWarmTemp()
{
Decimal celsius=TemperatureConvertor.FahrenheitToCelsius(70);
System.assertEquals(21.11, celsius);
}
@isTest static void testFreezingPoint()
{
Decimal celsius=TemperatureConvertor.FahrenheitToCelsius(32);
System.assertEquals(0,celsius);
}
@isTest static void testBoilingPoint()
{
Decimal celsius=TemperatureConvertor.FahrenheitToCelsius(212);
System.assertEquals(100,celsius,'Boiling point temperature is not expected ');
}
@isTest static void testNegativeTemp()
{
Decimal celsius=TemperatureConvertor.FahrenheitToCelsius(-10);
System.assertEquals(-23.33,celsius);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment