Fixing an issue with output parameters that are of type IntPtr
[castle.git] / Experiments / Attic / MVC / Castle.MVC.Test / WebFormTest.cs
blobc5ce9bf0048c819932cec63a229f25e0312a5ba9
1 using NUnit.Extensions.Asp;
2 using NUnit.Extensions.Asp.AspTester;
3 using NUnit.Framework;
5 namespace Castle.MVC.Test
7 /// <summary>
8 /// (If you receive a 401 Access Denied error, check your security settings.
9 /// For example, try enabling anonymous access for the GuestBook virtual directory,
10 /// and make sure the IUSR_machinename user has read access to the directory.)
11 /// </summary>
12 [TestFixture]
13 public class WebFormTest : WebFormTestCase
16 [Test]
17 public void TestGoToPage2WithButtonLogin()
19 // First, instantiate "Tester" objects:
20 ButtonTester buttonLogin = new ButtonTester("ButtonLogin", CurrentWebForm);
21 LabelTester labelTester = new LabelTester("LabelPreviousView", CurrentWebForm);
23 // Second, visit the page being tested:
24 Browser.GetPage("http://localhost/Castle.MVC.Test.Web/Views/index.aspx");
25 string loginPage = this.Browser.CurrentUrl.AbsoluteUri.ToString();
27 buttonLogin.Click();
28 string currentPage = this.Browser.CurrentUrl.AbsoluteUri.ToString();
29 Assert(currentPage, loginPage != currentPage);
30 AssertEquals("index", labelTester.Text);
33 [Test]
34 public void TestGoToPage2ViaLinkButton()
36 // First, instantiate "Tester" objects:
37 ButtonTester buttonLogin = new ButtonTester("ButtonLogin", CurrentWebForm);
38 LinkButtonTester link = new LinkButtonTester("LinkToPage2", CurrentWebForm);
39 LabelTester labelTester = new LabelTester("LabelPreviousView", CurrentWebForm);
41 // Second, visit the page being tested:
42 Browser.GetPage("http://localhost/Castle.MVC.Test.Web/Views/index.aspx");
43 string loginPage = this.Browser.CurrentUrl.AbsoluteUri.ToString();
45 link.Click();
46 string currentPage = this.Browser.CurrentUrl.AbsoluteUri.ToString();
47 Assert(currentPage, loginPage != currentPage);
48 AssertEquals("index", labelTester.Text);
51 [Test]
52 public void TestGoToPage2ViaButtoninUserControl()
54 // First, instantiate "Tester" objects:
55 UserControlTester myUserControl = new UserControlTester("MyUserControl", CurrentWebForm);
56 ButtonTester buttonGoToPage2 = new ButtonTester("GoToPage2", myUserControl);
57 LabelTester labelTester = new LabelTester("LabelPreviousView", CurrentWebForm);
59 // Second, visit the page being tested:
60 Browser.GetPage("http://localhost/Castle.MVC.Test.Web/Views/index.aspx");
61 string loginPage = this.Browser.CurrentUrl.AbsoluteUri.ToString();
63 buttonGoToPage2.Click();
64 string currentPage = this.Browser.CurrentUrl.AbsoluteUri.ToString();
65 Assert(currentPage, loginPage != currentPage);
66 AssertEquals("index", labelTester.Text);
69 [Test]
70 public void TestGoToPageIndex()
72 // First, instantiate "Tester" objects:
73 ButtonTester buttonLogin = new ButtonTester("ButtonLogin", CurrentWebForm);
74 ButtonTester button= new ButtonTester("Button", CurrentWebForm);
76 Browser.GetPage("http://localhost/Castle.MVC.Test.Web/Views/index.aspx");
77 string loginPage = this.Browser.CurrentUrl.AbsoluteUri.ToString();
78 buttonLogin.Click();
79 button.Click();
80 string currentPage = this.Browser.CurrentUrl.AbsoluteUri.ToString();
81 Assert(currentPage, loginPage.ToLower() == currentPage.ToLower());