示例#1
0
 /// <summary>
 /// Event Handler for the Route Request
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void LogRouteRequests(object sender, RouteRequestEventArgs e)
 {
     if (_requests.ContainsKey(e.ToCity.Name))
         _requests[e.ToCity.Name] += 1;
     else
         _requests[e.ToCity.Name] = 1;
     Console.WriteLine("ToCity: {0} has been requested {1} times", e.ToCity.Name, _requests[e.ToCity.Name]);
 }
示例#2
0
 /// <summary>
 /// Event Handler for the Route Request
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void LogRouteRequests(object sender, RouteRequestEventArgs e)
 {
     if (_requests.ContainsKey(e.ToCity.Name))
     {
         _requests[e.ToCity.Name] += 1;
     }
     else
     {
         _requests[e.ToCity.Name] = 1;
     }
     Console.WriteLine("ToCity: {0} has been requested {1} times", e.ToCity.Name, _requests[e.ToCity.Name]);
 }
示例#3
0
文件: Lab3Test.cs 项目: mjenny/ECNF
 public void TestForCorrectEventArgsWithNotFoundCities(object sender, RouteRequestEventArgs e)
 {
     Assert.AreEqual("doesNotExist", e.FromCity.Name);
     Assert.AreEqual("either", e.ToCity.Name);
 }
示例#4
0
文件: Lab3Test.cs 项目: mjenny/ECNF
 public void TestForCorrectEventArgsWithFoundCities(object sender, RouteRequestEventArgs e)
 {
     Assert.AreEqual("Bern", e.FromCity.Name);
     Assert.AreEqual("Zürich", e.ToCity.Name);
 }