示例#1
0
        public void EnumTest()
        {
            var serialiser = new QueryStringSerialiser<SimpleEnumTestClass>();

            var test = new SimpleEnumTestClass();

            var mapped = serialiser.Map(test);
            var output = serialiser.Load(mapped);

            Assert.AreEqual(test, output);
        }
示例#2
0
        public void BadValueBadParseEnumTest()
        {
            var serialiser = new QueryStringSerialiser<BadValueEnumTestClass>();

            var test = new BadValueEnumTestClass { Test = BadValueEnum.False };

            var mapped = serialiser.Map(test);
            var output = serialiser.Load(mapped);

            Assert.AreEqual(test, output);

            // And there's your problem, this will pass.
            Assert.AreEqual(BadValueEnum.True, BadValueEnum.False);
        }
示例#3
0
        public void InvalidMaxValueEnumTest()
        {
            var serialiser = new QueryStringSerialiser<SimpleEnumTestClass>();

            var test = new SimpleEnumTestClass { Test = (TestEnum)int.MaxValue };

            var mapped = serialiser.Map(test);
            var output = serialiser.Load(mapped);

            Assert.AreEqual(test, output);
        }