Created
April 4, 2013 14:55
-
-
Save adilakhter/5311072 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestMethod] | |
[HostType("Asp.Net")] | |
[UrlToTest("http://localhost/ourwebapplication")] | |
public void TestMethod(){ | |
Page page = TestContext.RequestedPage; | |
PrivateObject privateObject = new PrivateObject(page); | |
Button button = (Button)page.FindControl("Button1"); | |
privateObject.Invoke("Button1_Click", button, EventArgs.Empty); | |
Label label = (Label)page.FindControl("Label1"); | |
Assert.AreEqual<string>("Hello World !!!!", label.Text); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment