コード例 #1
0
    [ExpectedException(typeof(Exception))] //delete through GET should not be allowed
    public void Get_Delete()
    {
        dynamic webPage    = new MockGet(new string[] { "Mock", "Delete", "y", "z" });
        dynamic controller = new MockController();

        Mvc.Run(webPage, controller);
        controller.Verify();
    }
コード例 #2
0
    public void Get_Edit_Pass_String()
    {
        dynamic webPage    = new MockGet(new string[] { "Mock", "Edit", "y", "z" });
        dynamic controller = new MockController();

        Mvc.Run(webPage, controller);
        Assert.AreEqual("y/z", controller.Id);
        controller.Verify();
    }
コード例 #3
0
    public void Routing_Post()
    {
        dynamic webPage    = new MockPost(new string[] { "Mock", "a", "b", "c" }, null);
        dynamic controller = new MockController();

        Mvc.Run(webPage, controller);
        Assert.IsTrue(controller.Post_Called);
        controller.Verify();
    }
コード例 #4
0
    public void Routing_Get()
    {
        dynamic webPage    = new MockGet(new string[] { "Mock", "a", "1", "2" });
        dynamic controller = new MockController();

        Mvc.Run(webPage, controller);
        Assert.IsTrue(controller.Get_Called);
        controller.Verify();
    }
コード例 #5
0
    public void Post_Delete()
    {
        dynamic webPage    = new MockPost(new string[] { "Mock", "Delete", "y", "z" }, null);
        dynamic controller = new MockController();

        Mvc.Run(webPage, controller);
        Assert.AreEqual("y/z", controller.Id);
        controller.Verify();
    }
コード例 #6
0
    public void Routing_All()
    {
        dynamic webPage    = new MockGet(new string[] { "Mock", "x", "y", "z" });
        dynamic controller = new MockController();

        Mvc.Run(webPage, controller);
        Assert.IsTrue(controller.All_Called);
        Assert.AreEqual("y", controller.UrlData[1]);
        Assert.AreEqual("z", controller.UrlData[2]);
        controller.Verify();
    }
コード例 #7
0
    public void Post_Edit_Pass_Form()
    {
        dynamic webPage = new MockPost(new string[] { "Mock", "Edit", "y", "z" }, null);

        webPage.Request.TestValue = -20.3m;

        dynamic controller = new MockController();

        Mvc.Run(webPage, controller);

        Assert.AreEqual("y/z", controller.Id);
        Assert.AreEqual(-20.3m, controller.TestValue);

        controller.Verify();
    }
コード例 #8
0
ファイル: MvcTest.cs プロジェクト: yysun/Rabbit
 public void Get_Edit_Pass_String()
 {
     dynamic webPage = new MockGet(new string[] { "Mock", "Edit", "y", "z" });
     dynamic controller = new MockController();
     Mvc.Run(webPage, controller);
     Assert.AreEqual("y/z", controller.Id);
     controller.Verify();
 }
コード例 #9
0
ファイル: MvcTest.cs プロジェクト: yysun/Rabbit
 public void Get_Delete()
 {
     dynamic webPage = new MockGet(new string[] { "Mock", "Delete", "y", "z" });
     dynamic controller = new MockController();
     Mvc.Run(webPage, controller);
     controller.Verify();
 }
コード例 #10
0
ファイル: MvcTest.cs プロジェクト: yysun/Rabbit
 public void Routing_Post()
 {
     dynamic webPage = new MockPost(new string[] { "Mock", "a", "b", "c" }, null);
     dynamic controller = new MockController();
     Mvc.Run(webPage, controller);
     Assert.IsTrue(controller.Post_Called);
     controller.Verify();
 }
コード例 #11
0
ファイル: MvcTest.cs プロジェクト: yysun/Rabbit
 public void Routing_Get()
 {
     dynamic webPage = new MockGet(new string[] { "Mock", "a", "1", "2" });
     dynamic controller = new MockController();
     Mvc.Run(webPage, controller);
     Assert.IsTrue(controller.Get_Called);
     controller.Verify();
 }
コード例 #12
0
ファイル: MvcTest.cs プロジェクト: yysun/Rabbit
 public void Routing_All()
 {
     dynamic webPage = new MockGet(new string[] { "Mock", "x", "y", "z" });
     dynamic controller = new MockController();
     Mvc.Run(webPage, controller);
     Assert.IsTrue(controller.All_Called);
     Assert.AreEqual("y", controller.UrlData[1]);
     Assert.AreEqual("z", controller.UrlData[2]);
     controller.Verify();
 }
コード例 #13
0
ファイル: MvcTest.cs プロジェクト: yysun/Rabbit
    public void Post_Edit_Pass_Form()
    {
        dynamic webPage = new MockPost(new string[] { "Mock", "Edit", "y", "z" }, null);
        webPage.Request.TestValue = -20.3m;

        dynamic controller = new MockController();
        Mvc.Run(webPage, controller);

        Assert.AreEqual("y/z", controller.Id);
        Assert.AreEqual(-20.3m, controller.TestValue);

        controller.Verify();
    }
コード例 #14
0
ファイル: MvcTest.cs プロジェクト: yysun/Rabbit
 public void Post_Delete()
 {
     dynamic webPage = new MockPost(new string[] { "Mock", "Delete", "y", "z" }, null);
     dynamic controller = new MockController();
     Mvc.Run(webPage, controller);
     Assert.AreEqual("y/z", controller.Id);
     controller.Verify();
 }