public void HandlesEnum() { var item = new ObjectWithEnumProperty { Name = "Ferris Bueller", SomeEnum = SomeEnum.PlusOne }; var json = new SimpleJsonSerializer().Serialize(item); Assert.Equal("{\"name\":\"Ferris Bueller\",\"some_enum\":\"+1\"}", json); }
public void HandlesEnum() { var item = new ObjectWithEnumProperty { Name = "Ferris Bueller", SomeEnum = SomeEnum.Unicode, SomeEnumNullable = SomeEnum.Unicode, StringEnum = SomeEnum.SomethingElse, StringEnumNullable = SomeEnum.SomethingElse }; var json = new SimpleJsonSerializer().Serialize(item); Assert.Equal("{\"name\":\"Ferris Bueller\",\"some_enum\":\"unicode\",\"some_enum_nullable\":\"unicode\",\"string_enum\":\"something else\",\"string_enum_nullable\":\"something else\"}", json); }