public void Test_to_rankine_generic_from_celsius_with_invalid_parameter_throws_exception(double input) { // Arrange. var inputCelsius = new CelsiusString(input.ToString(CultureInfo.InvariantCulture)); // Act. var result = Assert.Throws <ArgumentOutOfRangeException>(() => inputCelsius.To <Rankine>()); // Assert. result.Message.Should().Contain("Value out of range for type."); }
public void Test_to_gas_generic_from_celsius_throws_out_of_range_exception_too_high() { // Arrange. var input = new CelsiusString("271"); // Act. var result = Assert.Throws <ArgumentOutOfRangeException>(() => input.To <Gas>()); // Assert. result.Message.Should().Contain("Temp too high for gas mark!"); }
public void Test_to_celsius_generic_from_celsius_returns_same_value() { // Arrange. var input = new CelsiusString("42"); // Act. var result = input.To <Celsius>(); // Assert. result.Should().Be(input.Temperature); }
public void Test_to_rankine_generic_from_celsius_returns_correct_value() { // Arrange. const string expected = "851.6699999999998"; var input = new CelsiusString("200"); // Act. var result = input.To <Rankine>(); // Assert. result.Should().Be(expected); }
public void Test_to_kelvin_generic_from_celsius_returns_correct_value() { // Arrange. const string expected = "473.15"; var input = new CelsiusString("200"); // Act. var result = input.To <Kelvin>(); // Assert. result.Should().Be(expected); }
public void Test_to_fahrenheit_generic_from_celsius_returns_same_value() { // Arrange. const string expected = "53.6"; var input = new CelsiusString("12"); // Act. var result = input.To <Fahrenheit>(); // Assert. result.Should().Be(expected); }