Ejemplo n.º 1
0
        public void TestThrowsOnInvalidTypeRequest()
        {
            var reader = new PosixConfigReader(PosixConfigReaderTestFiles.ValidConfigFile);

            Assert.Throws <ConfigException>(() => reader.GetConfigAsInteger(ValidStringKey));
            Assert.Throws <ConfigException>(() => reader.GetConfigAsDouble(ValidPosixPathKey));
        }
Ejemplo n.º 2
0
        public void TestReadGoodFile()
        {
            var reader = new PosixConfigReader(PosixConfigReaderTestFiles.ValidConfigFile);

            Assert.That(reader.GetConfigAsString(ValidStringKey), Is.EqualTo(ValidStringValue));
            Assert.That(reader.GetConfigAsInteger(ValidIntKey), Is.EqualTo(ValidIntValue));
            Assert.That(reader.GetConfigAsDouble(ValidDoubleKey), Is.EqualTo(ValidDoubleValue));
            Assert.That(reader.GetConfigAsString(ValidPosixPathKey), Is.EqualTo(ValidPosixPathValue));
            Assert.That(reader.GetConfigAsString(ValidWindowsPathKey), Is.EqualTo(ValidWindowPathValue));
            Assert.That(reader.GetConfigAsString(ValidConnStrKey), Is.EqualTo(ValidConnStrValue));
        }