38#include <gtest/gtest.h>
46TEST(TemperatureTest, Constructor)
52TEST(TemperatureTest, Conversion)
60 EXPECT_EQ(freezing.
toKelvin(), 273.15);
65TEST(TemperatureTest, Comparison)
90TEST(TemperatureTest, BinaryOperators)
100TEST(TemperatureTest, AssignmentOperators)
119TEST(TemperatureTest, OutStream)
122 std::ostringstream
ss;
123 ss <<
"T: " << temp << std::endl;
124 EXPECT_EQ(
"T: 42K\n",
ss.str());
The class stores temperatures in Kelvin and provides helper methods to convert to/from Celsius.
static Temperature fromCelsius(double _value)
constexpr double toKelvin() const
constexpr double toCelsius() const
static Temperature fromFahrenheit(double _value)
static Temperature fromKelvin(double _value)
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
TEST(TemperatureTest, Constructor)