예제 #1
0
        public void Options_FieldTest()
        {
            var testOptions = new TestableOptions <SimpleTestOptions>(new SimpleTestOptions(testString));

            Assert.IsNotNull(testOptions.Value.TestField);
            Assert.IsNull(testOptions["TestField"]);
        }
예제 #2
0
        public void Options_SimpleTest()
        {
            var testOptions = new TestableOptions <SimpleTestOptions>(new SimpleTestOptions(testString));

            Assert.IsNotNull(testOptions.Value.TestProperty);
            Assert.AreEqual(testString, testOptions.Value.TestProperty);
        }
예제 #3
0
        public void Options_NullValueTest()
        {
            var testOptions = new TestableOptions <NullValueTestOptions>(new NullValueTestOptions());

            Assert.IsNull(testOptions.Value.Test);
            Assert.IsNull(testOptions["test"]);
        }
예제 #4
0
        public void Options_GetPropertyWithCasingTest()
        {
            var testOptions = new TestableOptions <SimpleTestOptions>(new SimpleTestOptions(testString));

            Assert.AreEqual(testString, testOptions["TestProperty"]);
            Assert.AreEqual(testString, testOptions["testproperty"]);
            Assert.AreEqual(testString, testOptions["TeStPrOpErTy"]);
        }
예제 #5
0
        public void Options_TypeTest()
        {
            var testOptions = new TestableOptions <TypeTestOptions>(new TypeTestOptions());

            Assert.IsNotNull(testOptions);
            Assert.IsInstanceOfType(testOptions, typeof(IOptions <TypeTestOptions>));
            Assert.IsNotNull(testOptions.Value);
            Assert.IsInstanceOfType(testOptions.Value, typeof(TypeTestOptions));
        }
예제 #6
0
        public void Options_UnknownPropertyTest()
        {
            var testOptions = new TestableOptions <SimpleTestOptions>(new SimpleTestOptions(testString));

            Assert.IsNull(testOptions["UnknownProperty"]);
        }