Exemplo n.º 1
0
        public void ImportTuple1FromNull()
        {
            var importer = new ValueTupleImporter(typeof(ValueTuple <int>));
            var result   = importer.Import(JsonConvert.CreateImportContext(), JsonText.CreateReader("null"));

            Assert.IsNull(result);
        }
Exemplo n.º 2
0
        static void AssertImport(object expected, string input)
        {
            var importer = new ValueTupleImporter(expected.GetType());
            var reader   = JsonText.CreateReader(input);
            var context  = JsonConvert.CreateImportContext();
            var actual   = importer.Import(context, reader);

            Assert.IsTrue(reader.EOF, "Reader must be at EOF.");
            Assert.AreEqual(expected, actual);
        }