/// ------------------------------------------------------------------------------------ /// <summary> /// We get this message from the person informant when a person's UI ID has changed. /// When that happens, we just need to update the Text in the participant control. No /// change is needed (or desirable) in the underlying metadata. /// </summary> /// ------------------------------------------------------------------------------------ private void HandlePersonsUiIdChanged(object sender, ElementIdChangedArgs e) { var contribs = _model.Contributions; foreach (var c in contribs.Where(c => c.ContributorName == e.OldId)) { c.ContributorName = e.NewId; } _model.SetContributionList(contribs); }
public void TestSetup() { var system = new OlacSystem(); _model = new ContributorsListControlViewModel(null, null); _contributions = new ContributionCollection(new[] { new Contribution("Leroy", system.GetRoles().ElementAt(0)), new Contribution("Jed", system.GetRoles().ElementAt(1)), new Contribution("Art", system.GetRoles().ElementAt(2)) }); _model.SetContributionList(_contributions); }
public void SetContributionList_SetListToNull_YieldsEmptyList() { _model.SetContributionList(null); Assert.AreEqual(0, _model.Contributions.Count()); }