Example #1
0
        public void AirplaneDirection(string plane1Tag, int plane1X, int plane1Y, int plane1Alitude, string plane1Timestamp,
                                      string plane2Tag, int plane2X, int plane2Y, int plane2Alitude, string plane2Timestamp, double expected)
        {
            string   format     = "yyyyMMddHHmmssfff";
            DateTime plane1Time = DateTime.ParseExact(plane1Timestamp, format, CultureInfo.InvariantCulture);
            DateTime plane2Time = DateTime.ParseExact(plane2Timestamp, format, CultureInfo.InvariantCulture);

            var airplanePing1 = new Airplane(plane1Tag, plane1X, plane1Y, plane1Alitude, plane1Time);
            var airplanePing2 = new Airplane(plane2Tag, plane2X, plane2Y, plane2Alitude, plane2Time);

            //Create list of Airplanes
            List <Airplane> airplanesList = new List <Airplane>();

            airplanesList.Add(airplanePing1);

            //Unit under test/uut
            Calculator calculator = new Calculator(airplanesList);

            var actual = calculator.GetDirection(airplanePing2);

            Assert.AreEqual(actual, expected);
        }