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); }
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); }
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); }