static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); SimpleEmailValidator emailValidator = new Model.SimpleEmailValidator(); IFormValidator formValidator = new FormValidator(emailValidator); IFormView view = new FormView(); IFormModel model = new FormModel(formValidator); FormPresenter prezenter = new FormPresenter(view, model); Application.Run((Form)view); }
public void ValidationTest() { var document = LoadDocument("FormValidationTest.html"); var form = document.FindFirst("form").AsForm(); var presenter = new FormPresenter(); var result = new FormValidationResult(form, new[] { new FormValidationError("FirstName", "First Name is required!") }); presenter.ShowValidationResult(result); Assert.AreEqual(form.Element.FindFirst("#error_FirstName ul li").InnerText(), "First Name is required!"); }
public void SetupPresenter(FormPresenter presenter) { _presenter = presenter; }