Пример #1
0
        private static string ConvertTaxiInstructionsToSsml(TaxiInstructions taxiInstructions)
        {
            var spokenInstructions = $"{Random(InstructionsVariants)} {taxiInstructions.DestinationName} ";

            if (taxiInstructions.TaxiwayNames.Count > 0)
            {
                spokenInstructions += $"<break time=\"60ms\" /> {Random(ViaVariants)}<break time=\"60ms\" /> {string.Join(" <break time=\"60ms\" /> ", taxiInstructions.TaxiwayNames)}";
            }

            if (taxiInstructions.Comments.Count > 0)
            {
                spokenInstructions += $", {string.Join(", ", taxiInstructions.Comments)}";
            }

            return(spokenInstructions + ".");
        }
        public void TaxiToActiveRunway(TaxiScenario scenario)
        {
            var airfield   = Populator.Airfields.First(af => af.Name.Equals(scenario.Airfield));
            var controller = new GroundController(airfield);

            airfield.WindHeading = scenario.Wind;
            TaxiInstructions expected = new TaxiInstructions()
            {
                DestinationName = scenario.Destination,
                TaxiwayNames    = scenario.Taxiways,
                Comments        = new List <string>()
            };

            var actual = controller.GetTaxiInstructions(scenario.StartPoint);

            AssertInstructions(expected, actual);
        }
 public static void AssertInstructions(TaxiInstructions expected, TaxiInstructions actual)
 {
     StringAssert.Contains(expected.DestinationName, actual.DestinationName);
     CollectionAssert.AreEqual(expected.TaxiwayNames, actual.TaxiwayNames);
 }