Example #1
0
        public void SetAndRead_Settings()
        {
            var settings = new SettingsContainer(string.Empty);

            settings.SetValue("A", "A");
            settings.SetValue("B", 1);
            settings.SetValue("C", true);
            settings.SetValue("D", TimeSpan.Parse("12:30"));
            settings.SetValue("E", 1.1F);

            settings.GetString("A").ShouldBeEquivalentTo("A");
            settings.GetInteger("B").ShouldBeEquivalentTo(1);
            settings.GetBoolean("C").ShouldBeEquivalentTo(true);
            settings.GetTimeSpan("D").ShouldBeEquivalentTo(TimeSpan.Parse("12:30"));
            settings.GetFloat("E").ShouldBeEquivalentTo(1.1F);
        }