Пример #1
0
 public void ResolveFor_ShouldReturnFirstRoute_WhenMultipleRouteMatches()
 {
     var collection = new RouteCollection();
     var first = new TrueRoute { Name = "first route" };
     var second = new TrueRoute { Name = "second route" };
     collection.Add(first);
     collection.Add(second);
     var actual = (string)collection.ResolveFor(null).Data;
     Assert.AreEqual(first.Name, actual);
 }
Пример #2
0
 public MvcRequestHandler()
 {
     Routes = new RouteCollection();
 }
Пример #3
0
 public void ResolveFor_ShouldReturnRoute_WhenRouteMatches()
 {
     var collection = new RouteCollection();
     collection.Add(new TrueRoute());
     Assert.IsNotNull(collection.ResolveFor(null));
 }
Пример #4
0
 public void ResolveFor_ShouldReturnNull_WhenNoRoutesExist()
 {
     var collection = new RouteCollection();
     Assert.IsNull(collection.ResolveFor(null));
 }
Пример #5
0
 public void ResolveFor_ShouldReturnNull_WhenNoRouteMatches()
 {
     var collection = new RouteCollection();
     collection.Add(new FalseRoute());
     Assert.IsNull(collection.ResolveFor(null));
 }