public void ShouldThrowExceptionWhenTextIsNull()
            {
                var action = new PostbackAction()
                {
                    Label = "PostbackLabel"
                };

                ExceptionAssert.Throws <InvalidOperationException>("The data cannot be null.", () =>
                {
                    PostbackAction.Convert(action);
                });
            }
            public void ShouldConvertCustomIPostbackActionToPostbackAction()
            {
                var action = new TestPostbackAction();

                var postbackAction = PostbackAction.Convert(action);

                Assert.AreNotEqual(action, postbackAction);

                Assert.AreEqual("PostbackLabel", postbackAction.Label);
                Assert.AreEqual("PostbackData", postbackAction.Data);
                Assert.AreEqual("PostbackText", postbackAction.Text);
            }
            public void ShouldThrowExceptionWhenLabelIsNull()
            {
                var action = new PostbackAction()
                {
                    Data = "PostbackData"
                };

                ExceptionAssert.Throws <InvalidOperationException>("The label cannot be null.", () =>
                {
                    PostbackAction.Convert(action);
                });
            }
Ejemplo n.º 4
0
            public void ShouldPreserveInstanceWhenValueIsUriAction()
            {
                var action = new PostbackAction()
                {
                    Label = "PostbackLabel",
                    Data  = "PostbackData",
                    Text  = "PostbackText",
                };

                var messageAction = PostbackAction.Convert(action);

                Assert.AreSame(action, messageAction);
            }