コード例 #1
0
        public void Save_and_Load_work()
        {
            var manager = new UserSettingsManager();

            var settings = manager.LoadIfExists() ?? manager.MigrateOrDefault();

            var b = (byte)(new Random().NextDouble() * 255);

            settings.WhitebalanceBlue = b;
            // Save should happen automatically!

            var settings2 = manager.LoadIfExists();

            Assert.AreEqual(b, settings.WhitebalanceBlue, "settings.WhitebalanceBlue");
        }
コード例 #2
0
        public void Save_and_Load_work()
        {
            var manager = new UserSettingsManager();

            var settings = manager.LoadIfExists() ?? manager.MigrateOrDefault();

            var testDate = DateTime.UtcNow;

            settings.LastUpdateCheck = testDate;
            //save should happen automatically!

            var settings2 = manager.LoadIfExists();

            Assert.AreEqual(testDate, settings.LastUpdateCheck, "settings.LastUpdateCheck");
        }
コード例 #3
0
        public void Migration_works()
        {
            var manager = new UserSettingsManager();

            var settings = manager.MigrateOrDefault();
        }