public Preferences GetPreferences()
        {
            if (!PreferencesRepository.Exists())
            {
                PreferencesRepository.New();
            }

            var preferences = PreferencesRepository.All();

            return(preferences);
        }
Exemple #2
0
        public void ExistsTrue2()
        {
            var path = "ExistsTrue2.json";

            if (File.Exists(path))
            {
                File.Delete(path);
            }

            var target = new PreferencesRepository(path)
            {
                JsonSerializer = jsonSerializer
            };
            var actual = target.Exists();

            Assert.False(actual);
        }
Exemple #3
0
        public void ExistsTrue1()
        {
            var path = "ExistsTrue1.json";

            if (!File.Exists(path))
            {
                File.Create(path);
            }

            var target = new PreferencesRepository(path)
            {
                JsonSerializer = jsonSerializer
            };
            var actual = target.Exists();

            Assert.True(actual);
        }