public void ReadOnlyPropertyMustBeRespected()
        {
            var repo = new InMemoryRepository();
            var manager = new SettingsManagerPeriodic(repo);
            var settings = manager.Get<ReadOnlySettings>();
            settings.Text = "a";
            manager.Save(settings);
            settings = manager.Get<ReadOnlySettings>(true);
            Assert.AreNotEqual("a", settings.Text);

            manager.ChangeAndSave(s => s.Text = "b", settings);
            settings = manager.Get<ReadOnlySettings>(true);
            Assert.AreNotEqual("b", settings.Text);
        }
 public void PropertyChangedEventMustNotFireWhenPropertyValueNotChanged()
 {
     var repo = new InMemoryRepository();
     var manager = new SettingsManagerPeriodic(repo);
     var settings = manager.Get<Settings>();
     settings.Text = "old";
     var fired = false;
     manager.PropertyValueChanged += (sender, args) =>
     {
         fired = true;
     };
     manager.ChangeAndSave(s => s.Text = "old", settings);
     manager.Get<Settings>(true);
     Assert.IsFalse(fired);
 }