Beispiel #1
0
        public void Select_Invokes_Projection_Function_For_Read_Value()
        {
            var reader =
                from words in JsonReader.Array(JsonReader.String())
                select string.Join("-", from w in words select w.ToUpperInvariant());

            var result = reader.Read(JsonUtil.Strictify("['foo', 'bar', 'baz']"));

            Assert.Equal("FOO-BAR-BAZ", result);
        }
Beispiel #2
0
        public void Array_With_Valid_Input(ulong[] expected, string json)
        {
            var result = JsonReader.Array(JsonReader.UInt64()).Read(JsonUtil.Strictify(json));

            Assert.Equal(expected, result);
        }
Beispiel #3
0
 public void Array_With_Invalid_Input(string json)
 {
     Assert.Throws <JsonException>(() => _ = JsonReader.Array(JsonReader.UInt64()).Read(JsonUtil.Strictify(json)));
 }
Beispiel #4
0
 public void Array_Moves_Reader()
 {
     TestMovesReaderPastReadValue(JsonReader.Array(JsonReader.UInt64()), "[42]");
 }