예제 #1
0
        public async Task TestIniFromFile()
        {
            var iniConfigTest = new IniConfigTestImpl();
            var iniContainer  = CreateContainer("TestIniFromFile", iniConfigTest);
            await iniContainer.ReloadAsync();

            Assert.Equal(210u, iniConfigTest.Height);

            await iniContainer.WriteAsync();
        }
예제 #2
0
        public async Task TestIniAfterLoad()
        {
            var iniConfigTest = new IniConfigTestImpl();
            var iniContainer  = CreateContainer("TestIniAfterLoad", iniConfigTest);

            iniConfigTest.OnLoad = x =>
            {
                if (!x.SomeValues.ContainsKey("dapplo"))
                {
                    x.SomeValues.Add("dapplo", 2015);
                }
            };
            await LoadFromMemoryStreamAsync(iniContainer);

            Assert.True(iniConfigTest.SomeValues.ContainsKey("dapplo"));
            Assert.True(iniConfigTest.SomeValues["dapplo"] == 2015);
        }
예제 #3
0
        public async Task TestIniGeneral()
        {
            var iniConfigTest = new IniConfigTestImpl();
            var iniContainer  = CreateContainer("TestIniGeneral", iniConfigTest);
            await iniContainer.ReloadAsync();

            //Assert.Contains(new Uri("http://1.dapplo.net"), iniTest.MyUris);

            Assert.Equal(185u, iniConfigTest.Height);
            iniConfigTest.Height++;
            Assert.Equal(186u, iniConfigTest.Height);
            iniConfigTest.Height = 185;
            Assert.Equal(185u, iniConfigTest.Height);
            Assert.Equal(16, iniConfigTest.PropertySize.Width);
            Assert.Equal(100, iniConfigTest.PropertyArea.Width);
            Assert.True(iniConfigTest.WindowCornerCutShape.Count > 0);
            Assert.Equal("It works!", iniConfigTest.SubValuewithDefault);
            Assert.Equal(IniConfigTestValues.Value2, iniConfigTest.TestWithEnum);
            iniConfigTest.RestoreToDefault("TestWithEnum");
            Assert.Equal(IniConfigTestValues.Value2, iniConfigTest.TestWithEnum);
            Assert.Equal(IniConfigTestValues.Value2, iniConfigTest.TestWithEnumSubValue);
        }
예제 #4
0
        public void TestIniNoLoading_Defaults()
        {
            var iniConfigTest = new IniConfigTestImpl();

            Assert.Equal(IniConfigTestValues.Value2, iniConfigTest.TestWithEnum);
        }