Exemplo n.º 1
0
 public static void InvalidValueStringNumber()
 {
     JsonException ex = Assert.Throws <JsonException>(() =>
     {
         StoreColor s = JsonSerializer.Parse <StoreColor>("\"1\"");
     });
 }
Exemplo n.º 2
0
        public static void TestValidIntegerValue()
        {
            StoreColor c = JsonSerializer.Deserialize <StoreColor>("1");

            Assert.Equal(StoreColor.Black, c);
        }