Click here to Skip to main content
15,891,856 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am working on Test-Driven Development with NUnitAsp . I am having a webapplication project to test . In My test project i need to write a test method to compare the strings in two textbox . How is it Possible with AssertEquals ?? My Aim is if the input values in two textbox is same test should fail if not test should pass ......... 2) The length of the textbox elements should be less than 10..... The code which i tried is below


 public void TestLayout()
{
 name = new TextBoxTester("name", CurrentWebForm);
 comments = new TextBoxTester("comments", CurrentWebForm);
 save = new ButtonTester("save", CurrentWebForm);
 book = new DataGridTester("book", CurrentWebForm);

 Browser.GetPage("http://localhost:49786/GuestBook.aspx");
 SignGuestBook("ABC", "DEF!");

       string[][] expected = new string[][]
         {
                 new string[] {"ABC", "DEF!"},

         };
       AssertEquals("book", expected, book.TrimmedCells);
}

private void SignGuestBook(string nameToSign, string commentToSign)
   {
       name.Text = nameToSign;
       comments.Text = commentToSign;
       save.Click();
   }
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900