/// <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]); }
/// <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]); }
public void TestForCorrectEventArgsWithNotFoundCities(object sender, RouteRequestEventArgs e) { Assert.AreEqual("doesNotExist", e.FromCity.Name); Assert.AreEqual("either", e.ToCity.Name); }
public void TestForCorrectEventArgsWithFoundCities(object sender, RouteRequestEventArgs e) { Assert.AreEqual("Bern", e.FromCity.Name); Assert.AreEqual("Zürich", e.ToCity.Name); }