Exemplo n.º 1
0
        public void ShouldSubmitWebFormWithButton() {
            var url = "http://mysite.com/webform2.aspx";
            var expected = "success";
            Factory.Register(url, expected);
            var fields = new Dictionary<string, string>();
            var buttons = new Dictionary<string, string>();
            buttons.Add("login", "Entrar");
            var form = new WebForm { Action = url, Method = "POST", Fields = fields, Buttons = buttons, Cookies = new CookieCollection() };

            var response = form.Submit("login");

            Assert.IsNotNull(response);
            Assert.AreEqual(expected, response);
        }