Example #1
0
        public void AnalyzeCollision_AnalyzesCollisionBetweenTwoFlights_ReturnsTrue(int distance, int altitude)
        {
            _fakeDistanceCalculator
            .CalculateDistance(Arg.Any <double>(), Arg.Any <double>(), Arg.Any <double>(), Arg.Any <double>())
            .Returns(distance);
            _fakeAltitudeDistanceCalculator.CalculateAltitudeDistance(Arg.Any <int>(), Arg.Any <int>()).Returns(altitude);

            //Assert
            Assert.That(_uut.AnalyzeCollision(new Track(), new Track()), Is.EqualTo(true));
        }
 public bool AnalyzeCollision(Track flight1, Track flight2)
 {
     if (_horizontaDistanceCalculator.CalculateDistance(flight1.XCoordinate, flight2.XCoordinate,
                                                        flight1.YCoordinate, flight2.YCoordinate) < 5000 &&
         _altitudeDistanceCalculator.CalculateAltitudeDistance(flight1.Altitude, flight2.Altitude) < 300)
     {
         return(true);
     }
     return(false);
 }