public void FacetPropertyEditModel_mirrors_ViewModel() { // ARRANGE var model = new FacetProperty("p"); var viewModel = model.ToViewModel(); // ACT var result = new FacetPropertyEditModel(viewModel); // ASSERT Assert.Equal("p", result.Name); }
public void FacetPropertyEditModel_delays_changes_of_ViewModel() { // ARRANGE var model = new FacetProperty("p"); var viewModel = model.ToViewModel(); var editModel = new FacetPropertyEditModel(viewModel); // ACT editModel.Name = "changed"; // ASSERT Assert.Equal("p", viewModel.Name); }
public void AssignedFacetPropertyViewModel_changes_Model() { var model = new FacetProperty("p"); var values = new Dictionary <string, object> { { model.Id.ToString(), 1 } }; var viewModel = new AssignedFacetPropertyViewModel(model.ToViewModel(), values); // ACT // changing of name is not used. viewModel.Value = "value"; // ASSERT Assert.Equal("value", values.Single().Value); }
public void AssignedFacetPropertyViewModel_mirrors_Model() { var model = new FacetProperty("p"); var values = new Dictionary <string, object> { { model.Id.ToString(), 1 } }; // ACT var result = new AssignedFacetPropertyViewModel(model.ToViewModel(), new Dictionary <string, object> { { model.Id.ToString(), 1 } }); // ASSERT Assert.Equal("p", result.Property.Name); Assert.Equal(1, result.Value); }
public void FacetPropertyEditModel_commits_changes_to_ViewModel() { // ARRANGE var model = new FacetProperty("p"); var viewModel = model.ToViewModel(); var editModel = new FacetPropertyEditModel(viewModel); editModel.Name = "changed"; // ACT editModel.CommitCommand.Execute(null); // ASSERT Assert.Equal("changed", editModel.Name); Assert.Equal("changed", viewModel.Name); Assert.Equal("changed", model.Name); }
public void AssigedFacetPropertyEditModel_delays_change_from_ViewModel() { // ARRANGE var model = new FacetProperty("p"); var values = new Dictionary <string, object> { { model.Id.ToString(), 1 } }; var viewModel = new AssignedFacetPropertyViewModel(model.ToViewModel(), values); var editModel = new AssignedFacetPropertyEditModel(viewModel); // ACT editModel.Value = "value"; // ASSERT Assert.Equal("value", editModel.Value); Assert.Equal(1, viewModel.Value); }
public void AssigedFacetPropertyEditModel_commits_change_to_ViewModel() { // ARRANGE var model = new FacetProperty("p"); var values = new Dictionary <string, object> { { model.Id.ToString(), 1 } }; var viewModel = new AssignedFacetPropertyViewModel(model.ToViewModel(), values); var editModel = new AssignedFacetPropertyEditModel(viewModel); editModel.Value = "value"; // ACT editModel.CommitCommand.Execute(null); // ASSERT Assert.Equal("value", editModel.Value); Assert.Equal("value", viewModel.Value); }