public void ViewModelPropertySuffixedWithControlNameAndPropertyName() { var viewModel = new { HappyMealSuperSize = 15 }; var view = new WeirdView(); Subject.AddControlPropertyConvention("Meal", "SuperSize"); Subject.Bind(viewModel, view); Assert.That(view.Happy.SuperSize, Is.EqualTo(15)); }
public void RegisterControlAndPropertyForBinding() { var viewModel = new WeirdViewModel { HappyMeal = 12 }; var view = new WeirdView(); Subject.AddControlPropertyConvention("Meal", "SuperSize"); Subject.Bind(viewModel, view); Assert.That(view.Happy.SuperSize, Is.EqualTo(12)); viewModel.HappyMeal = 31; Assert.That(view.Happy.SuperSize, Is.EqualTo(31)); }