static void Run_VirtualPathData(string action, string url) { // Arrange var route = new Elfar.ErrorLogRoute(null); var request = Request; request.RouteData.Values.Add("action", action); // Act var vpd = route.GetVirtualPath(request, request.RouteData.Values); // Assert Assert.That(vpd, Is.Not.Null); Assert.That(vpd.VirtualPath, Is.EqualTo(url)); }
public void NotElfar_VirtualPathData() { // Arrange var route = new Elfar.ErrorLogRoute(null); var request = Request; request.RouteData.Values["controller"] = "Default"; request.RouteData.Values["action"] = "Default"; // Act var vpd = route.GetVirtualPath(request, request.RouteData.Values); // Assert Assert.That(vpd, Is.Null); }
static void Run_VirtualPathData(string action) { // Arrange var route = new Elfar.ErrorLogRoute(null); var request = Request; request.RouteData.Values["id"] = Guid.Empty; request.RouteData.Values["action"] = action; // Act var vpd = route.GetVirtualPath(request, request.RouteData.Values); // Assert Assert.That(vpd, Is.Not.Null); Assert.That(vpd.VirtualPath, Is.EqualTo("elfar/00000000-0000-0000-0000-000000000000" + (action == "Default" ? null : "/" + action))); }
static void Run_VirtualPathData(string action, string url) { // Arrange var route = new Elfar.ErrorLogRoute(null); var request = Request; request.RouteData.Values.Add("action", action); // Act var vpd = route.GetVirtualPath(request, request.RouteData.Values); // Assert Assert.That(vpd, Is.Not.Null); Assert.That(vpd.VirtualPath, Is.EqualTo(url)); }
static void Run_VirtualPathData(string action) { // Arrange var route = new Elfar.ErrorLogRoute(null); var request = Request; request.RouteData.Values["id"] = Guid.Empty; request.RouteData.Values["action"] = action; // Act var vpd = route.GetVirtualPath(request, request.RouteData.Values); // Assert Assert.That(vpd, Is.Not.Null); Assert.That(vpd.VirtualPath, Is.EqualTo("elfar/00000000-0000-0000-0000-000000000000" + (action == "Default" ? null : "/" + action))); }
public void NotElfar_VirtualPathData() { // Arrange var route = new Elfar.ErrorLogRoute(null); var request = Request; request.RouteData.Values["controller"] = "Default"; request.RouteData.Values["action"] = "Default"; // Act var vpd = route.GetVirtualPath(request, request.RouteData.Values); // Assert Assert.That(vpd, Is.Null); }