public void WhenPersisting_ShouldUseFullTypename() { var manager = new SettingsManager(Microsoft.VisualStudio.Shell.ServiceProvider.GlobalProvider); var foo = new FooSettings(manager); foo.BeginEdit(); foo.DefaultValueStringProperty = "WhenEndingEdit_ValuesShouldPersist"; foo.DefaultValueIntProperty = 65001; foo.EndEdit(); var sameTypeName = new Clide.IntegrationTests.OtherNamespace.FooSettings(manager); sameTypeName.BeginEdit(); sameTypeName.DefaultValueStringProperty = "abc"; sameTypeName.DefaultValueIntProperty = 123; sameTypeName.EndEdit(); // reload from settings store manager.Read(foo); manager.Read(sameTypeName); // check the just edited values are there Assert.Equal("WhenEndingEdit_ValuesShouldPersist", foo.DefaultValueStringProperty); Assert.Equal(65001, foo.DefaultValueIntProperty); Assert.Equal("abc", sameTypeName.DefaultValueStringProperty); Assert.Equal(123, sameTypeName.DefaultValueIntProperty); }
public void WhenEndingEdit_ValuesShouldPersist() { var manager = new SettingsManager(Microsoft.VisualStudio.Shell.ServiceProvider.GlobalProvider); var foo = new FooSettings(manager); foo.BeginEdit(); foo.DefaultValueStringProperty = "WhenEndingEdit_ValuesShouldPersist"; foo.DefaultValueIntProperty = 65001; foo.EndEdit(); // reload from settings store manager.Read(foo); // check the just edited values are there Assert.Equal("WhenEndingEdit_ValuesShouldPersist", foo.DefaultValueStringProperty); Assert.Equal(65001, foo.DefaultValueIntProperty); }
public void WhenCancellingEdit_ValuesShouldNotPersist() { var manager = new SettingsManager(Microsoft.VisualStudio.Shell.ServiceProvider.GlobalProvider); var foo = new FooSettings(manager); foo.BeginEdit(); // change the current value foo.DefaultValueStringProperty = "WhenCancellingEdit_ValuesShouldNotPersist"; foo.DefaultValueIntProperty = 65000; // cancel edit, should revert edit changes back to original values foo.CancelEdit(); // check just edited values are not there anymore Assert.NotEqual("WhenCancellingEdit_ValuesShouldNotPersist", foo.DefaultValueStringProperty); Assert.NotEqual(65000, foo.DefaultValueIntProperty); }