Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Temperature"/> struct.
 /// </summary>
 /// <param name="temperature">The value of temperature.</param>
 /// <param name="unit">The unit of temperature.</param>
 public Temperature(double temperature, Units.Temperature unit)
 {
     switch (unit)
     {
     case Units.Temperature.Celsius:
     default:
         this.temperature = temperature;
         break;
     }
 }
Exemplo n.º 2
0
        public void InequalityPositive(double valueA, Units.Temperature unitA, double valueB, Units.Temperature unitB)
        {
            var first  = new Core.Types.Temperature(valueA, unitA);
            var second = new Core.Types.Temperature(valueB, unitB);

            Assert.AreNotEqual(first, second);
            Assert.AreNotEqual((object)first, (object)second);
            Assert.AreNotEqual(first.GetHashCode(), second.GetHashCode());
            Assert.IsTrue(first != second);
        }
Exemplo n.º 3
0
 /// <inheritdoc/>
 public double GetTemperature(Units.Temperature unit)
 {
     return(this.temperature);
 }
Exemplo n.º 4
0
 public void ToString(string expected, double temperature, Units.Temperature unit)
 {
     Assert.AreEqual(expected, new Core.Types.Temperature(temperature, unit).ToString());
 }
Exemplo n.º 5
0
        public void Constructor(double temperature, Units.Temperature unit)
        {
            var instance = new Core.Types.Temperature(temperature, unit);

            Assert.AreEqual(temperature, instance.GetTemperature(unit));
        }