public void ApplyChanges_Updates_All_Specified_Items_To_New_Values() { //Arrange var mgr = new SimpleSettingsMgr(); PointF expectedLoc = new PointF(33f, 55f); string item1Name = "Location"; IDictionary<string, object> changes = new Dictionary<string, object>(); changes.Add(item1Name, expectedLoc); string comment = "blah"; string item2Name = "Comments"; changes.Add(item2Name, comment); //Act mgr.ApplyChanges(changes); //Assert object val1 = mgr[item1Name]; Assert.Equal(expectedLoc, val1); object val2 = mgr[item2Name]; Assert.Equal(comment, val2); }
public void ApplyChanges_Does_Not_Fire_SettingsChangedEvent_After_All_Changes_Are_Made() { //Arrange var mgr = new SimpleSettingsMgr(); var helper = new HelperForSettingsMgr(); mgr.SettingsChanged += new SettingsChangedEventHandler<ISettings, SettingsChangedEventArgs> (helper.SettingsChanged_DummyHandler); PointF expectedLoc = new PointF(33f, 55f); string item1Name = "Location"; IDictionary<string, object> changes = new Dictionary<string, object>(); changes.Add(item1Name, expectedLoc); string comment = "blah"; string item2Name = "Comments"; changes.Add(item2Name, comment); //Act mgr.ApplyChanges(changes); //Assert Assert.Equal(0, helper.SettingsChanged_TimesCalled); }