private void button1_Click(object sender, EventArgs e) { if (movieValidator.ValidateMovie(txtTitle.Text.Trim(), txtGenre.Text.Trim(), txtActors.Text.Trim())) { adminMovieHandler.CreateMovie(txtTitle.Text.Trim(), txtGenre.Text.Trim(), txtActors.Text.Trim()); } else { MessageBox.Show("Invalid data"); } }
public void TestValidateMovie() { var movieValidator = new MovieValidator(); Assert.IsFalse(movieValidator.ValidateMovie("123124;';'", "Action", "Portman")); }