Esempio n. 1
0
        public void CalculateSpeed_CorrectParameters_ReturnsValue(double lat1, double long1, int time1, double lat2, double long2, int time2, double speed)
        {
            ISSPosition issPosition1 = new ISSPosition();

            issPosition1.ISS_Position = new Position(lat1, long1);
            issPosition1.Timestamp    = time1;
            ISSPosition issPosition2 = new ISSPosition();

            issPosition2.ISS_Position = new Position(lat2, long2);
            issPosition2.Timestamp    = time2;
            LatLongCalculator pathCalculator = new LatLongCalculator();

            Assert.AreEqual(speed, pathCalculator.CalculateSpeed(issPosition1, issPosition2), 0.5);
        }
Esempio n. 2
0
        public void CalculateSpeed_IncorrectParameters_Throws(double lat1, double long1, int time1, double lat2, double long2, int time2)
        {
            ISSPosition issPosition1 = new ISSPosition();

            issPosition1.ISS_Position = new Position(lat1, long1);
            issPosition1.Timestamp    = time1;
            ISSPosition issPosition2 = new ISSPosition();

            issPosition2.ISS_Position = new Position(lat2, long2);
            issPosition2.Timestamp    = time2;
            LatLongCalculator pathCalculator = new LatLongCalculator();

            Assert.Throws <ArgumentOutOfRangeException>(() => pathCalculator.CalculateSpeed(issPosition1, issPosition2));
        }