本文整理汇总了C#中Route.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Route.ToString方法的具体用法?C# Route.ToString怎么用?C# Route.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Route
的用法示例。
在下文中一共展示了Route.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToStringWithStationsTest
public void ToStringWithStationsTest()
{
Route route = new Route(1);
Station station1 = new Station("station1");
Station station2 = new Station("station2");
Station station3 = new Station("station3");
route.Stations.Add(station1);
route.Stations.Add(station2);
route.Stations.Add(station3);
Assert.AreEqual("station1 , station2 , station3", route.ToString());
}
示例2: WrapActionWithExceptionHandling
private Func<OwinContext, object> WrapActionWithExceptionHandling(Route.RouteMethod method, Action<OwinContext> actionFunc)
{
return context =>
{
try
{
actionFunc(context);
return null;
}
catch (Exception e)
{
Robot.Logger.Error(string.Format("Error receiving {0} Router message", method.ToString()), e);
return HttpStatusCode.InternalServerError;
}
};
}
示例3: ToStringWithoutStationsTest
public void ToStringWithoutStationsTest()
{
Route route = new Route(1);
Assert.AreEqual("No Stations available", route.ToString());
}