private static void AssertImport(object expected, string input)
 {
     JsonTextReader reader = new JsonTextReader(new StringReader(input));
     GuidImporter importer = new GuidImporter();
     object o = importer.Import(new ImportContext(), reader);
     Assert.IsTrue(reader.EOF, "Reader must be at EOF.");
     if (expected != null)
         Assert.IsInstanceOfType(typeof(Guid), o);
     Assert.AreEqual(expected, o);
 }
示例#2
0
        static void AssertImport(object expected, string input)
        {
            var reader   = new JsonTextReader(new StringReader(input));
            var importer = new GuidImporter();
            var o        = importer.Import(new ImportContext(), reader);

            Assert.IsTrue(reader.EOF, "Reader must be at EOF.");
            if (expected != null)
            {
                Assert.IsInstanceOf <Guid>(o);
            }
            Assert.AreEqual(expected, o);
        }
示例#3
0
        private static void AssertImport(object expected, string input)
        {
            JsonTextReader reader   = new JsonTextReader(new StringReader(input));
            GuidImporter   importer = new GuidImporter();
            object         o        = importer.Import(new ImportContext(), reader);

            Assert.IsTrue(reader.EOF, "Reader must be at EOF.");
            if (expected != null)
            {
                Assert.IsInstanceOfType(typeof(Guid), o);
            }
            Assert.AreEqual(expected, o);
        }