public void Test01_10までのFizzBuzz結果の確認() { var target = new FizzBuzzForm(); target.Show(); new TextBoxTester("maxNumberTextBox", target).Enter("10"); new ButtonTester("fizzBuzzButton", target).Click(); var dataGrid = new Finder<DataGridView>("fizzBuzzDataGridView", target).Find(); var expectedList = new[] { new { Number = 1, Text = "1" }, new { Number = 2, Text = "2" }, new { Number = 3, Text = "Fizz" }, new { Number = 4, Text = "4" }, new { Number = 5, Text = "Buzz" }, new { Number = 6, Text = "Fizz" }, new { Number = 7, Text = "7" }, new { Number = 8, Text = "8" }, new { Number = 9, Text = "Fizz" }, new { Number = 10, Text = "Buzz" }, }; foreach (var expected in expectedList) AssertForOneRow(dataGrid, expected.Number, expected.Text); }
private void バリデーションメッセージ確認(string text, string message) { var target = new FizzBuzzForm(); target.Show(); DialogBoxHandler = (title, handle) => { var messageBox = new MessageBoxTester(handle); Assert.That(messageBox.Text, Is.EqualTo(message)); messageBox.ClickOk(); }; new TextBoxTester("maxNumberTextBox", target).Enter(text); new ButtonTester("fizzBuzzButton", target).Click(); }