Ejemplo n.º 1
0
        public static void VerifyMvcPage(Func <ActionResult> func)
        {
            string clazz  = func.Target.GetType().Name.Replace("Controller", String.Empty);
            string action = func.Method.Name;

            AspApprovals.VerifyUrl("http://localhost:{0}/{1}/{2}".FormatWith(PortFactory.MvcPort, clazz, action));
        }
Ejemplo n.º 2
0
 public static void VerifyApprovalBootstrap()
 {
     VerifyWithException(() =>
     {
         AspApprovals.VerifyUrl($"http://localhost:{PortFactory.MvcPort}/ApprovalTests/Echo/Testing123");
     });
 }
Ejemplo n.º 3
0
        public void TestSimpleInvoice()
        {
            AspApprovals.VerifyAspPage(new InvoiceView().TestSimpleInvoice, HtmlScrubbers.ScrubAsp);

            //  -- These are the same thing
            //AspApprovals.VerifyUrl("http://localhost:1360/Orders/InvoiceView.aspx?TestSimpleInvoice");
        }
Ejemplo n.º 4
0
        public void TestUrlResolving()
        {
            PortFactory.AspPort = 1000;
            var urls = new[] { "~/home", "/home", "http://www.google.com" };

            Approvals.VerifyAll("Resolving:", urls,
                                u => $"{u} => {AspApprovals.ResolveUrl(u)}");
        }
Ejemplo n.º 5
0
 private static void VerifyMvcUrl(string clazz, string action, NameValueCollection nvc = null)
 {
     VerifyWithException(() =>
     {
         var url = GetURL(clazz, action, nvc);
         AspApprovals.VerifyUrl(url, HtmlScrubbers.ScrubMvc);
     });
 }
Ejemplo n.º 6
0
 private static void VerifyMvcUrl(string clazz, string action, NameValueCollection nvc = null, Func <string, string> scrubber = null)
 {
     VerifyWithException(() =>
     {
         var url = GetURL(clazz, action, nvc);
         AspApprovals.VerifyUrl(url, ScrubberUtils.Combine(HtmlScrubbers.ScrubMvc, scrubber ?? ScrubberUtils.NO_SCRUBBER));
     });
 }
Ejemplo n.º 7
0
        public void TestUrlResolving()
        {
            PortFactory.AspPort = 1000;
            var urls = new[] { "~/home", "/home", "http://www.google.com" };

            Approvals.VerifyAll("Resolving:", urls,
                                u => "{0} => {1}".FormatWith(u, AspApprovals.ResolveUrl(u)));
        }
Ejemplo n.º 8
0
        public void TestSimpleInvoice()
        {
            PortFactory.AspPort = 1359;
            Func <string, string> htmlScrubber = s => Regex.Replace(s, AspViewState, "<!-- aspviewstate -->");

            AspApprovals.VerifyAspPage(new InvoiceView().TestSimpleInvoice, htmlScrubber);

            //  -- These are the same thing
            //AspApprovals.VerifyUrl("http://localhost:1359/Orders/InvoiceView.aspx?TestSimpleInvoice");
        }
Ejemplo n.º 9
0
        public void TestRoutes()
        {
            var urls = new[] { "/Home/Index/Hello", "/" };

            AspApprovals.VerifyRouting(MvcApplication.RegisterRoutes, urls);
        }
Ejemplo n.º 10
0
 public void TestInternationalization()
 {
     AspApprovals.VerifyUrl("http://localhost:1360/Encoding.UTF8.html", HtmlScrubbers.ScrubBrowserLink);
 }
Ejemplo n.º 11
0
 //[Test] [TestMethod]
 public void LockWeb()
 {
     AspApprovals.VerifyUrl("http://localhost:51795//");
 }
Ejemplo n.º 12
0
 public void TestMissingRoutes()
 {
     AspApprovals.VerifyRouting(r => { }, "/");
 }