Пример #1
0
        public void RenderDiagnosticMetadataAttributesWithCommand()
        {
            var webButton = new TestWebButton {
                ID = "WebButton", CommandName = "MyCommand"
            };

            var renderedText = RenderControl(webButton);

            Assert.That(renderedText, Is.StringContaining(DiagnosticMetadataAttributes.ControlType + "=\"WebButton\""));
            Assert.That(renderedText, Is.StringContaining(DiagnosticMetadataAttributes.CommandName + "=\"MyCommand\""));
            Assert.That(renderedText, Is.StringContaining(DiagnosticMetadataAttributes.TriggersPostBack + "=\"true\""));
        }
Пример #2
0
        public void RenderDiagnosticMetadataAttributes()
        {
            var webButton = new TestWebButton {
                ID = "WebButton", Text = "My Button"
            };

            var renderedText = RenderControl(webButton);

            Assert.That(renderedText, Is.StringContaining(DiagnosticMetadataAttributes.ControlType + "=\"WebButton\""));
            Assert.That(renderedText, Is.StringContaining(DiagnosticMetadataAttributes.ItemID + "=\"" + webButton.ID + "\""));
            Assert.That(renderedText, Is.StringContaining(DiagnosticMetadataAttributes.Content + "=\"" + webButton.Text + "\""));
            Assert.That(renderedText, Is.Not.StringContaining(DiagnosticMetadataAttributes.CommandName));
            Assert.That(renderedText, Is.StringContaining(DiagnosticMetadataAttributes.TriggersPostBack + "=\"true\""));
        }
Пример #3
0
 protected override void SetUpPage()
 {
     base.SetUpPage();
     _webButton    = new TestWebButton();
     _webButton.ID = "WebButton";
 }