Esempio n. 1
0
        public void ViewModel_CalculatePerimeter(string width, string length, int output)
        {
            var vm = new MainFormViewModel();

            vm.Width  = width;
            vm.Length = length;

            int perimeter = vm.GetPerimeter();

            Assert.Equal(output, perimeter);
        }
Esempio n. 2
0
 private void ButtonDoCalc_Click(object sender, EventArgs e)
 {
     try
     {
         _labelArea.Text      = _viewModel.GetArea().ToString();
         _labelPerimeter.Text = _viewModel.GetPerimeter().ToString();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Ошибка");
     }
 }