Ejemplo n.º 1
0
        public void Options_FieldTest()
        {
            var testOptions = new TestableOptions <SimpleTestOptions>(new SimpleTestOptions(testString));

            Assert.IsNotNull(testOptions.Value.TestField);
            Assert.IsNull(testOptions["TestField"]);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
        public void Options_NullValueTest()
        {
            var testOptions = new TestableOptions <NullValueTestOptions>(new NullValueTestOptions());

            Assert.IsNull(testOptions.Value.Test);
            Assert.IsNull(testOptions["test"]);
        }
Ejemplo n.º 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"]);
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 6
0
        public void Options_UnknownPropertyTest()
        {
            var testOptions = new TestableOptions <SimpleTestOptions>(new SimpleTestOptions(testString));

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