public void InstructionGenerationAFewTurns() { // create new interpreter. var interpreter = new OsmRoutingInterpreter(); // create the language generator. var languageGenerator = new LanguageTestGenerator(); // calculate the route. OsmSharpRoute route = this.Calculate( new GeoCoordinate(51.089900970459, 3.44386267662048), new GeoCoordinate(51.0862655639648, 3.44465517997742)); // generate the instructions. var instructionGenerator = new InstructionGenerator(); List<Instruction> instructions = instructionGenerator.Generate(route, interpreter, languageGenerator); // test the results in the language generator. Assert.AreEqual(6, instructions.Count); Assert.AreEqual("GeneratePoi:1", instructions[0].Text); Assert.AreEqual("GenerateDirectTurn:0_Right_0", instructions[1].Text); Assert.AreEqual("GenerateDirectTurn:0_Left_0", instructions[2].Text); Assert.AreEqual("GenerateDirectTurn:0_Left_0", instructions[3].Text); Assert.AreEqual("GenerateDirectTurn:0_Right_0", instructions[4].Text); Assert.AreEqual("GeneratePoi:1", instructions[5].Text); }
public void InstructionGenerationNoTurns() { // create new interpreter. var interpreter = new OsmRoutingInterpreter(); // create the language generator. var languageGenerator = new LanguageTestGenerator(); // calculate the route. OsmSharpRoute route = this.Calculate( new GeoCoordinate(51.09002, 3.44380), new GeoCoordinate(51.089900970459, 3.44386267662048)); // generate the instructions. var instructionGenerator = new InstructionGenerator(); List<Instruction> instructions = instructionGenerator.Generate(route, interpreter, languageGenerator); // test the results in the language generator. Assert.AreEqual(2, instructions.Count); Assert.AreEqual("GeneratePoi:1", instructions[0].Text); Assert.AreEqual("GeneratePoi:1", instructions[1].Text); }
public void InstructionGenerationSimpleTurnSameStreet() { // create new interpreter. var interpreter = new OsmRoutingInterpreter(); // create the language generator. var languageGenerator = new LanguageTestGenerator(); // calculate the route. OsmSharpRoute route = this.Calculate( new GeoCoordinate(51.09030, 3.44391), new GeoCoordinate(51.09002, 3.44380)); // generate the instructions. var instructionGenerator = new InstructionGenerator(); List<Instruction> instructions = instructionGenerator.Generate(route, interpreter, languageGenerator); // test the results in the language generator. Assert.AreEqual(3, instructions.Count); Assert.AreEqual("GeneratePoi:1", instructions[0].Text); Assert.AreEqual("GenerateDirectTurn:0_Left_0", instructions[1].Text); Assert.AreEqual("GeneratePoi:1", instructions[2].Text); }