public void 正常() { var viewModel = new BmiViewModel(); viewModel.Height = 172; viewModel.Weight = 66; viewModel.CalcCommand.Execute(null); Assert.That(viewModel.Bmi, Is.EqualTo(22.30)); }
public void プロパティの変更通知確認() { var viewModel = new BmiViewModel(); String propertyName = ""; viewModel.PropertyChanged += new PropertyChangedEventHandler((s, e) => { propertyName = e.PropertyName; }); viewModel.Height = 172; viewModel.Weight = 66; Assert.That(propertyName, Is.EqualTo("")); viewModel.CalcCommand.Execute(null); Assert.That(propertyName, Is.EqualTo("Bmi")); }