public void TestIfSettingsAreSuccessfullySerialized()
        {
            var settings = SettingsModel.Initialize("Assets/UMVC.Editor.Tests/Settings.asset");

            Assert.NotNull(settings);

            settings.logo = TestsExtensions.RandomString();
            settings.Save(out var newSettings);

            Assert.NotNull(newSettings);
            Assert.IsTrue(newSettings != settings);
            Assert.IsTrue(newSettings.logo == settings.logo);

            settings.Delete();
        }
示例#2
0
        public void TestSingletonUpdateModel()
        {
            var logo = DerivedUMVC.Instance.Settings.logo;

            DerivedUMVC.Instance.Settings.logo = TestsExtensions.RandomString();
            DerivedUMVC.Instance.UpdateSettingsModel();

            var settingsModelLogo = DerivedUMVC.Instance.Settings.logo;

            DerivedUMVC.Instance.Settings.logo = TestsExtensions.RandomString();
            DerivedUMVC.Instance.UpdateSettingsModel();

            Assert.IsTrue(settingsModelLogo != DerivedUMVC.Instance.Settings.logo);

            DerivedUMVC.Instance.Settings.logo = logo;
            DerivedUMVC.Instance.UpdateSettingsModel();
        }