//******************************************************************************************************// TemperatureTest.cs - Gbtc//// Copyright © 2012, Grid Protection Alliance. All Rights Reserved.//// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See// the NOTICE file distributed with this work for additional information regarding copyright ownership.// The GPA licenses this file to you under the MIT License (MIT), the "License"; you may// not use this file except in compliance with the License. You may obtain a copy of the License at://// http://www.opensource.org/licenses/MIT//// Unless agreed to in writing, the subject software distributed under the License is distributed on an// "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the// License for the specific language governing permissions and limitations.//// Code Modification History:// ----------------------------------------------------------------------------------------------------// 02/01/2011 - Denis Kholine// 12/13/2012 - Starlynn Danyelle Gilliam// MOdified Header.////****************************************************************************************************** #region [ University of Illinois/NCSA Open Source License ]/*Copyright © <2012> <University of Illinois>All rights reserved. Developed by: <ITI><University of Illinois><http://www.iti.illinois.edu/>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal with the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:• Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimers.• Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimers in the documentation and/or other materials provided with the distribution.• Neither the names of <Name of Development Group, Name of Institution>, nor the names of its contributors may be used to endorse or promote products derived from this Software without specific prior written permission.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.*/#endregion using System;using System.Collections.Generic;using System.Globalization;using GSF.Units;using Microsoft.VisualStudio.TestTools.UnitTesting; namespace GSF.Core.Tests{ /// <summary> ///This is a test class for TemperatureTest and is intended ///to contain all TemperatureTest Unit Tests ///</summary> [TestClass] public class TemperatureTest { private TestContext testContextInstance; /// <summary> ///Gets or sets the test context which provides ///information about and functionality for the current test run. ///</summary> public TestContext TestContext { get { return testContextInstance; } set { testContextInstance = value; } } #region Additional test attributes // //You can use the following additional attributes as you write your tests: // //Use ClassInitialize to run code before running the first test in the class //[ClassInitialize()] //public static void MyClassInitialize(TestContext testContext) //{ //} // //Use ClassCleanup to run code after all tests in a class have run //[ClassCleanup()] //public static void MyClassCleanup() //{ //} // //Use TestInitialize to run code before running each test //[TestInitialize()] //public void MyTestInitialize() //{ //} // //Use TestCleanup to run code after each test has run //[TestCleanup()] //public void MyTestCleanup() //{ //} // #endregion /// <summary> ///A test for op_Subtraction ///</summary> [TestMethod] public void op_SubtractionTest() { Temperature value1 = new Temperature(10F); Temperature value2 = new Temperature(10F); Temperature expected = new Temperature(0F); Temperature actual; actual = (value1 - value2); Assert.AreEqual(expected, actual); } /// <summary> ///A test for op_Multiply ///</summary> [TestMethod] public void op_MultiplyTest() { Temperature value1 = new Temperature(10F); Temperature value2 = new Temperature(10F); Temperature expected = new Temperature(100F); Temperature actual; actual = (value1 * value2); Assert.AreEqual(expected, actual); } /// <summary> ///A test for op_Modulus ///</summary> [TestMethod] public void op_ModulusTest() { Temperature value1 = new Temperature(10F); Temperature value2 = new Temperature(10F); Temperature expected = new Temperature(0F); Temperature actual; actual = (value1 % value2); Assert.AreEqual(expected, actual); } /// <summary> ///A test for op_LessThanOrEqual ///</summary> [TestMethod] public void op_LessThanOrEqualTest() { Temperature value1 = new Temperature(10F); Temperature value2 = new Temperature(10F); bool expected = true; bool actual; actual = (value1 <= value2); Assert.AreEqual(expected, actual); } /// <summary> ///A test for op_LessThan ///</summary> [TestMethod] public void op_LessThanTest() { Temperature value1 = new Temperature(10F); Temperature value2 = new Temperature(11F); bool expected = true; bool actual; actual = (value1 < value2); Assert.AreEqual(expected, actual); } /// <summary> ///A test for op_Inequality ///</summary> [TestMethod] public void op_InequalityTest() { Temperature value1 = new Temperature(10F); Temperature value2 = new Temperature(11F); bool expected = true; bool actual; actual = (value1 != value2); Assert.AreEqual(expected, actual); } /// <summary> ///A test for op_Implicit ///</summary> [TestMethod] public void op_ImplicitTemperatureTest() { double value = 10F; Temperature expected = new Temperature(10F); Temperature actual; actual = value; Assert.AreEqual(expected, actual); } /// <summary> ///A test for op_Implicit ///</summary> [TestMethod] public void op_ImplicitDoubleTest() { Temperature value = new Temperature(10F); double expected = 10F; double actual; actual = value; Assert.AreEqual(expected, actual); } /// <summary> ///A test for op_GreaterThanOrEqual ///</summary> [TestMethod] public void op_GreaterThanOrEqualTest() { Temperature value1 = new Temperature(10F); Temperature value2 = new Temperature(10F); bool expected = true; bool actual; actual = (value1 >= value2); Assert.AreEqual(expected, actual); } /// <summary> ///A test for op_GreaterThan ///</summary> [TestMethod] public void op_GreaterThanTest() { Temperature value1 = new Temperature(10F); Temperature value2 = new Temperature(9F); bool expected = true; bool actual; actual = (value1 > value2); Assert.AreEqual(expected, actual); } /// <summary> ///A test for op_Exponent ///</summary> [TestMethod] public void op_ExponentTest() { Temperature value1 = new Temperature(2F); Temperature value2 = new Temperature(3F); double expected = 8F; double actual; actual = Temperature.op_Exponent(value1, value2); Assert.AreEqual(expected, actual); } /// <summary> ///A test for op_Equality ///</summary> [TestMethod] public void op_EqualityTest() { Temperature value1 = new Temperature(10F); Temperature value2 = new Temperature(10F); bool expected = true; bool actual; actual = (value1 == value2); Assert.AreEqual(expected, actual); } /// <summary> ///A test for op_Division ///</summary> [TestMethod] public void op_DivisionTest() { Temperature value1 = new Temperature(10F); Temperature value2 = new Temperature(10F); Temperature expected = new Temperature(1F); Temperature actual; actual = (value1 / value2); Assert.AreEqual(expected, actual); } /// <summary> ///A test for op_Addition ///</summary> [TestMethod] public void op_AdditionTest() { Temperature value1 = new Temperature(10F); Temperature value2 = new Temperature(10F); Temperature expected = new Temperature(20F); Temperature actual; actual = (value1 + value2); Assert.AreEqual(expected, actual); } /// <summary> /// A test for TryParse /// Converts the string representation of a number in a specified style and culture-specific format to its /// <see cref="Temperature"/> equivalent. A return value indicates whether the conversion succeeded or failed. /// </summary> /// <param name="s">A string containing a number to convert.</param> /// <param name="style"> /// A bitwise combination of System.Globalization.NumberStyles values that indicates the permitted format of s. /// </param> /// <param name="result"> /// When this method returns, contains the <see cref="Temperature"/> value equivalent to the number contained in s, /// if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null, /// is not in a format compliant with style, or represents a number less than <see cref="Temperature.MinValue"/> or /// greater than <see cref="Temperature.MaxValue"/>. This parameter is passed uninitialized. /// </param> /// <param name="provider"> /// A <see cref="System.IFormatProvider"/> object that supplies culture-specific formatting information about s. /// </param> /// <returns>true if s was converted successfully; otherwise, false.</returns> /// <exception cref="ArgumentException"> /// style is not a System.Globalization.NumberStyles value. -or- style is not a combination of /// System.Globalization.NumberStyles.AllowHexSpecifier and System.Globalization.NumberStyles.HexNumber values. /// </exception> [TestMethod] public void TryParseStyleProviderResultTest() { double value = 10F; string s = value.ToString(); NumberStyles style = new NumberStyles(); IFormatProvider provider = null; Temperature result = new Temperature(value); Temperature resultExpected = new Temperature(value); bool expected = true; bool actual; actual = Temperature.TryParse(s, style, provider, out result); Assert.AreEqual(resultExpected, result); Assert.AreEqual(expected, actual); } /// <summary> /// A test for TryParse /// Converts the string representation of a number to its <see cref="Temperature"/> equivalent. A return value /// indicates whether the conversion succeeded or failed. /// </summary> /// <param name="s">A string containing a number to convert.</param> /// <param name="result"> /// When this method returns, contains the <see cref="Temperature"/> value equivalent to the number contained in s, /// if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null, /// is not of the correct format, or represents a number less than <see cref="Temperature.MinValue"/> or greater than <see cref="Temperature.MaxValue"/>. /// This parameter is passed uninitialized. /// </param> /// <returns>true if s was converted successfully; otherwise, false.</returns> [TestMethod] public void TryParseResultTest() { double value = 10F; string s = value.ToString(); Temperature result = new Temperature(value); Temperature resultExpected = new Temperature(value); bool expected = true; bool actual; actual = Temperature.TryParse(s, out result); Assert.AreEqual(resultExpected, result); Assert.AreEqual(expected, actual); } ///// <summary> /////A test for ToTemperature /////</summary> //[TestMethod] //[DeploymentItem("GSF.Core.dll")] //public void ToTemperatureTest() //{ // // Creation of the private accessor for 'Microsoft.VisualStudio.TestTools.TypesAndSymbols.Assembly' failed // Assert.Inconclusive("Creation of the private accessor for \'Microsoft.VisualStudio.TestTools.TypesAndSy" + // "mbols.Assembly\' failed"); //} /// <summary> /// A test for ToString /// Converts the numeric value of this instance to its equivalent string representation, using /// the specified format. /// </summary> /// <param name="format">A format string.</param> /// <returns> /// The string representation of the value of this instance as specified by format. /// </returns> [TestMethod] public void ToStringFormatTest() { double value = 10F; Temperature target = new Temperature(value); string format = string.Empty; string expected = value.ToString(); string actual; actual = target.ToString(format); Assert.AreEqual(expected, actual); } /// <summary> /// A test for ToString /// Converts the numeric value of this instance to its equivalent string representation. /// </summary> /// <returns> /// The string representation of the value of this instance, consisting of a minus sign if /// the value is negative, and a sequence of digits ranging from 0 to 9 with no leading zeroes. /// </returns> [TestMethod] public void ToStringTest() { double value = 10F; Temperature target = new Temperature(value); string expected = value.ToString(); string actual; actual = target.ToString(); Assert.AreEqual(expected, actual); } /// <summary> /// A test for ToString /// Converts the numeric value of this instance to its equivalent string representation using the /// specified culture-specific format information. /// </summary> /// <param name="provider"> /// A <see cref="System.IFormatProvider"/> that supplies culture-specific formatting information. /// </param> /// <returns> /// The string representation of the value of this instance as specified by provider. /// </returns> [TestMethod] public void ToStringProviderTest() { double value = 10F; Temperature target = new Temperature(value); IFormatProvider provider = null; string expected = value.ToString(); string actual; actual = target.ToString(provider); Assert.AreEqual(expected, actual); } /// <summary> /// A test for ToString /// Converts the numeric value of this instance to its equivalent string representation using the /// specified format and culture-specific format information. /// </summary> /// <param name="format">A format specification.</param> /// <param name="provider"> /// A <see cref="System.IFormatProvider"/> that supplies culture-specific formatting information. /// </param> /// <returns> /// The string representation of the value of this instance as specified by format and provider. /// </returns> [TestMethod] public void ToStringFormatProviderTest() { double value = 10F; Temperature target = new Temperature(value); string format = string.Empty; IFormatProvider provider = null; string expected = value.ToString(); string actual; actual = target.ToString(format, provider); Assert.AreEqual(expected, actual); } /// <summary> /// A test for ToRømer /// Gets the <see cref="Temperature"/> value in Rømer. /// </summary> /// <returns>Value of <see cref="Temperature"/> in Rømer.</returns> [TestMethod] public void ToRømerTest() { double value = 10F; Temperature target = new Temperature(value); double expected = -130.65375; double actual; actual = target.ToRømer(); Assert.AreEqual(expected, actual); } /// <summary>A test for ToRéaumur /// Gets the <see cref="Temperature"/> value in Réaumur. /// </summary> /// <returns>Value of <see cref="Temperature"/> in Réaumur.</returns> [TestMethod] public void ToRéaumurTest() { double value = 10F; Temperature target = new Temperature(value); double expected = -210.51999999999998; double actual; actual = target.ToRéaumur(); Assert.AreEqual(expected, actual); } /// <summary> /// A test for ToRankine /// Gets the <see cref="Temperature"/> value in Rankine. /// </summary>Lines 1–500 of 1225. Load more
//****************************************************************************************************** // TemperatureTest.cs - Gbtc // // Copyright © 2012, Grid Protection Alliance. All Rights Reserved. // // Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See // the NOTICE file distributed with this work for additional information regarding copyright ownership. // The GPA licenses this file to you under the MIT License (MIT), the "License"; you may // not use this file except in compliance with the License. You may obtain a copy of the License at: // // http://www.opensource.org/licenses/MIT // // Unless agreed to in writing, the subject software distributed under the License is distributed on an // "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the // License for the specific language governing permissions and limitations. // // Code Modification History: // ---------------------------------------------------------------------------------------------------- // 02/01/2011 - Denis Kholine // 12/13/2012 - Starlynn Danyelle Gilliam // MOdified Header. // //****************************************************************************************************** #region [ University of Illinois/NCSA Open Source License ] /* Copyright © <2012> <University of Illinois> All rights reserved. Developed by: <ITI> <University of Illinois> <http://www.iti.illinois.edu/> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal with the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimers. • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimers in the documentation and/or other materials provided with the distribution. • Neither the names of <Name of Development Group, Name of Institution>, nor the names of its contributors may be used to endorse or promote products derived from this Software without specific prior written permission. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. */ #endregion using System; using System.Collections.Generic; using System.Globalization; using GSF.Units; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace GSF.Core.Tests { /// <summary> ///This is a test class for TemperatureTest and is intended ///to contain all TemperatureTest Unit Tests ///</summary> [TestClass] public class TemperatureTest { private TestContext testContextInstance; /// <summary> ///Gets or sets the test context which provides ///information about and functionality for the current test run. ///</summary> public TestContext TestContext { get { return testContextInstance; } set { testContextInstance = value; } } #region Additional test attributes // //You can use the following additional attributes as you write your tests: // //Use ClassInitialize to run code before running the first test in the class //[ClassInitialize()] //public static void MyClassInitialize(TestContext testContext) //{ //} // //Use ClassCleanup to run code after all tests in a class have run //[ClassCleanup()] //public static void MyClassCleanup() //{ //} // //Use TestInitialize to run code before running each test //[TestInitialize()] //public void MyTestInitialize() //{ //} // //Use TestCleanup to run code after each test has run //[TestCleanup()] //public void MyTestCleanup() //{ //} // #endregion /// <summary> ///A test for op_Subtraction ///</summary> [TestMethod] public void op_SubtractionTest() { Temperature value1 = new Temperature(10F); Temperature value2 = new Temperature(10F); Temperature expected = new Temperature(0F); Temperature actual; actual = (value1 - value2); Assert.AreEqual(expected, actual); } /// <summary> ///A test for op_Multiply ///</summary> [TestMethod] public void op_MultiplyTest() { Temperature value1 = new Temperature(10F); Temperature value2 = new Temperature(10F); Temperature expected = new Temperature(100F); Temperature actual; actual = (value1 * value2); Assert.AreEqual(expected, actual); } /// <summary> ///A test for op_Modulus ///</summary> [TestMethod] public void op_ModulusTest() { Temperature value1 = new Temperature(10F); Temperature value2 = new Temperature(10F); Temperature expected = new Temperature(0F); Temperature actual; actual = (value1 % value2); Assert.AreEqual(expected, actual); } /// <summary> ///A test for op_LessThanOrEqual ///</summary> [TestMethod] public void op_LessThanOrEqualTest() { Temperature value1 = new Temperature(10F); Temperature value2 = new Temperature(10F); bool expected = true; bool actual; actual = (value1 <= value2); Assert.AreEqual(expected, actual); } /// <summary> ///A test for op_LessThan ///</summary> [TestMethod] public void op_LessThanTest() { Temperature value1 = new Temperature(10F); Temperature value2 = new Temperature(11F); bool expected = true; bool actual; actual = (value1 < value2); Assert.AreEqual(expected, actual); } /// <summary> ///A test for op_Inequality ///</summary> [TestMethod] public void op_InequalityTest() { Temperature value1 = new Temperature(10F); Temperature value2 = new Temperature(11F); bool expected = true; bool actual; actual = (value1 != value2); Assert.AreEqual(expected, actual); } /// <summary> ///A test for op_Implicit ///</summary> [TestMethod] public void op_ImplicitTemperatureTest() { double value = 10F; Temperature expected = new Temperature(10F); Temperature actual; actual = value; Assert.AreEqual(expected, actual); } /// <summary> ///A test for op_Implicit ///</summary> [TestMethod] public void op_ImplicitDoubleTest() { Temperature value = new Temperature(10F); double expected = 10F; double actual; actual = value; Assert.AreEqual(expected, actual); } /// <summary> ///A test for op_GreaterThanOrEqual ///</summary> [TestMethod] public void op_GreaterThanOrEqualTest() { Temperature value1 = new Temperature(10F); Temperature value2 = new Temperature(10F); bool expected = true; bool actual; actual = (value1 >= value2); Assert.AreEqual(expected, actual); } /// <summary> ///A test for op_GreaterThan ///</summary> [TestMethod] public void op_GreaterThanTest() { Temperature value1 = new Temperature(10F); Temperature value2 = new Temperature(9F); bool expected = true; bool actual; actual = (value1 > value2); Assert.AreEqual(expected, actual); } /// <summary> ///A test for op_Exponent ///</summary> [TestMethod] public void op_ExponentTest() { Temperature value1 = new Temperature(2F); Temperature value2 = new Temperature(3F); double expected = 8F; double actual; actual = Temperature.op_Exponent(value1, value2); Assert.AreEqual(expected, actual); } /// <summary> ///A test for op_Equality ///</summary> [TestMethod] public void op_EqualityTest() { Temperature value1 = new Temperature(10F); Temperature value2 = new Temperature(10F); bool expected = true; bool actual; actual = (value1 == value2); Assert.AreEqual(expected, actual); } /// <summary> ///A test for op_Division ///</summary> [TestMethod] public void op_DivisionTest() { Temperature value1 = new Temperature(10F); Temperature value2 = new Temperature(10F); Temperature expected = new Temperature(1F); Temperature actual; actual = (value1 / value2); Assert.AreEqual(expected, actual); } /// <summary> ///A test for op_Addition ///</summary> [TestMethod] public void op_AdditionTest() { Temperature value1 = new Temperature(10F); Temperature value2 = new Temperature(10F); Temperature expected = new Temperature(20F); Temperature actual; actual = (value1 + value2); Assert.AreEqual(expected, actual); } /// <summary> /// A test for TryParse /// Converts the string representation of a number in a specified style and culture-specific format to its /// <see cref="Temperature"/> equivalent. A return value indicates whether the conversion succeeded or failed. /// </summary> /// <param name="s">A string containing a number to convert.</param> /// <param name="style"> /// A bitwise combination of System.Globalization.NumberStyles values that indicates the permitted format of s. /// </param> /// <param name="result"> /// When this method returns, contains the <see cref="Temperature"/> value equivalent to the number contained in s, /// if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null, /// is not in a format compliant with style, or represents a number less than <see cref="Temperature.MinValue"/> or /// greater than <see cref="Temperature.MaxValue"/>. This parameter is passed uninitialized. /// </param> /// <param name="provider"> /// A <see cref="System.IFormatProvider"/> object that supplies culture-specific formatting information about s. /// </param> /// <returns>true if s was converted successfully; otherwise, false.</returns> /// <exception cref="ArgumentException"> /// style is not a System.Globalization.NumberStyles value. -or- style is not a combination of /// System.Globalization.NumberStyles.AllowHexSpecifier and System.Globalization.NumberStyles.HexNumber values. /// </exception> [TestMethod] public void TryParseStyleProviderResultTest() { double value = 10F; string s = value.ToString(); NumberStyles style = new NumberStyles(); IFormatProvider provider = null; Temperature result = new Temperature(value); Temperature resultExpected = new Temperature(value); bool expected = true; bool actual; actual = Temperature.TryParse(s, style, provider, out result); Assert.AreEqual(resultExpected, result); Assert.AreEqual(expected, actual); } /// <summary> /// A test for TryParse /// Converts the string representation of a number to its <see cref="Temperature"/> equivalent. A return value /// indicates whether the conversion succeeded or failed. /// </summary> /// <param name="s">A string containing a number to convert.</param> /// <param name="result"> /// When this method returns, contains the <see cref="Temperature"/> value equivalent to the number contained in s, /// if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null, /// is not of the correct format, or represents a number less than <see cref="Temperature.MinValue"/> or greater than <see cref="Temperature.MaxValue"/>. /// This parameter is passed uninitialized. /// </param> /// <returns>true if s was converted successfully; otherwise, false.</returns> [TestMethod] public void TryParseResultTest() { double value = 10F; string s = value.ToString(); Temperature result = new Temperature(value); Temperature resultExpected = new Temperature(value); bool expected = true; bool actual; actual = Temperature.TryParse(s, out result); Assert.AreEqual(resultExpected, result); Assert.AreEqual(expected, actual); } ///// <summary> /////A test for ToTemperature /////</summary> //[TestMethod] //[DeploymentItem("GSF.Core.dll")] //public void ToTemperatureTest() //{ // // Creation of the private accessor for 'Microsoft.VisualStudio.TestTools.TypesAndSymbols.Assembly' failed // Assert.Inconclusive("Creation of the private accessor for \'Microsoft.VisualStudio.TestTools.TypesAndSy" + // "mbols.Assembly\' failed"); //} /// <summary> /// A test for ToString /// Converts the numeric value of this instance to its equivalent string representation, using /// the specified format. /// </summary> /// <param name="format">A format string.</param> /// <returns> /// The string representation of the value of this instance as specified by format. /// </returns> [TestMethod] public void ToStringFormatTest() { double value = 10F; Temperature target = new Temperature(value); string format = string.Empty; string expected = value.ToString(); string actual; actual = target.ToString(format); Assert.AreEqual(expected, actual); } /// <summary> /// A test for ToString /// Converts the numeric value of this instance to its equivalent string representation. /// </summary> /// <returns> /// The string representation of the value of this instance, consisting of a minus sign if /// the value is negative, and a sequence of digits ranging from 0 to 9 with no leading zeroes. /// </returns> [TestMethod] public void ToStringTest() { double value = 10F; Temperature target = new Temperature(value); string expected = value.ToString(); string actual; actual = target.ToString(); Assert.AreEqual(expected, actual); } /// <summary> /// A test for ToString /// Converts the numeric value of this instance to its equivalent string representation using the /// specified culture-specific format information. /// </summary> /// <param name="provider"> /// A <see cref="System.IFormatProvider"/> that supplies culture-specific formatting information. /// </param> /// <returns> /// The string representation of the value of this instance as specified by provider. /// </returns> [TestMethod] public void ToStringProviderTest() { double value = 10F; Temperature target = new Temperature(value); IFormatProvider provider = null; string expected = value.ToString(); string actual; actual = target.ToString(provider); Assert.AreEqual(expected, actual); } /// <summary> /// A test for ToString /// Converts the numeric value of this instance to its equivalent string representation using the /// specified format and culture-specific format information. /// </summary> /// <param name="format">A format specification.</param> /// <param name="provider"> /// A <see cref="System.IFormatProvider"/> that supplies culture-specific formatting information. /// </param> /// <returns> /// The string representation of the value of this instance as specified by format and provider. /// </returns> [TestMethod] public void ToStringFormatProviderTest() { double value = 10F; Temperature target = new Temperature(value); string format = string.Empty; IFormatProvider provider = null; string expected = value.ToString(); string actual; actual = target.ToString(format, provider); Assert.AreEqual(expected, actual); } /// <summary> /// A test for ToRømer /// Gets the <see cref="Temperature"/> value in Rømer. /// </summary> /// <returns>Value of <see cref="Temperature"/> in Rømer.</returns> [TestMethod] public void ToRømerTest() { double value = 10F; Temperature target = new Temperature(value); double expected = -130.65375; double actual; actual = target.ToRømer(); Assert.AreEqual(expected, actual); } /// <summary>A test for ToRéaumur /// Gets the <see cref="Temperature"/> value in Réaumur. /// </summary> /// <returns>Value of <see cref="Temperature"/> in Réaumur.</returns> [TestMethod] public void ToRéaumurTest() { double value = 10F; Temperature target = new Temperature(value); double expected = -210.51999999999998; double actual; actual = target.ToRéaumur(); Assert.AreEqual(expected, actual); } /// <summary> /// A test for ToRankine /// Gets the <see cref="Temperature"/> value in Rankine. /// </summary>