Ejemplo n.º 1
0
        public void Test_Add_A_List_Readings()
        {
            var readings = new List<double> { -5, -10, 0.23, 12.53, 17.05 };

            ReadingsList readingsList = new ReadingsList();

            readingsList.Add(readings);

            double reading = readingsList.GetReading(4);

            Assert.AreEqual(17.05, reading);
        }
Ejemplo n.º 2
0
        public void Test_Minimum_Temperature_Of_The_Readings()
        {
            var readings = new List<double> { 10, 9.23, 12.53, 7.15, 17.05 };

            ReadingsList readingsList = new ReadingsList();

            readingsList.Add(readings);

            double minimumTemperature = readingsList.MinimumTemperature;

            Assert.AreEqual(7.15, minimumTemperature);
        }
Ejemplo n.º 3
0
        public void Test_Average_Of_The_Readings()
        {
            var readings = new List<double> { 7.15, 10, 9.23, 12.53, 17.05 };

            ReadingsList readingsList = new ReadingsList();

            readingsList.Add(readings);

            double average = readingsList.AverageTemperature;

            Assert.AreEqual(11.192, average, 3);
        }
Ejemplo n.º 4
0
        public void Test_Maximum_Temperature_Difference_Of_The_Readings()
        {
            var readings = new List<double> { 10, 9.23, 12.53, 7.15, 17.05 };

            ReadingsList readingsList = new ReadingsList();
            readingsList.Add(readings);

            double maximumTemperature = readingsList.MaximumDiference;

            Assert.AreEqual(9.9, maximumTemperature);
        }
Ejemplo n.º 5
0
        public void Test_Add_New_Reading()
        {
            ReadingsList readingsList = new ReadingsList();

            readingsList.Add(21.73);

            double reading = readingsList.GetReading(0);

            Assert.AreEqual(21.73, reading);
        }