12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- using Application.ATG_Classic_App;
- using Microsoft.VisualStudio.TestTools.UnitTesting;
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Threading.Tasks;
- namespace Application.ATG_Classic_App_Test
- {
- [TestClass]
- public class TemperatureCompensationCaculator_Test
- {
- [TestMethod]
- public async Task TestMethod1()
- {
- /*data are from real VR Console*/
- var caculator = new TemperatureCompensationCaculator(0.0007);
- double expect = 638.9;
- var actual = caculator.CaculateCompensatedVolume(15.556, 643.4, 25.5);
- Assert.AreEqual(expect, Math.Round(actual, 1, MidpointRounding.AwayFromZero));
- }
- [TestMethod]
- public async Task TestMethod2()
- {
- /*data are from real VR Console*/
- var caculator = new TemperatureCompensationCaculator(0.0007);
- double expect = 1582.3;
- var actual = caculator.CaculateCompensatedVolume(15.556, 1593.1, 25.2);
- Assert.AreEqual(expect, Math.Round(actual, 1, MidpointRounding.AwayFromZero));
- }
- [TestMethod]
- public async Task TestMethod3()
- {
- /*data are from real VR Console,
- * this test failed. not quite sure how it rounding, but we are close enough...
- * so leave it here.
- */
- var caculator = new TemperatureCompensationCaculator(0.0007);
- double expect = 1604.7;
- var actual = caculator.CaculateCompensatedVolume(35.556, 1593.2, 25.3);
- Assert.AreEqual(expect, Math.Round(actual, 1, MidpointRounding.AwayFromZero));
- }
- }
- }
|