Пример #1
0
 public void ImportTellsObjectToImportSelf()
 {
     ImportAwareImporter importer = new ImportAwareImporter(typeof(Thing));
     JsonRecorder writer = new JsonRecorder();
     writer.WriteString(string.Empty);
     Thing thing = (Thing) importer.Import(new ImportContext(), writer.CreatePlayer());
     Assert.IsTrue(thing.ImportCalled);
 }
Пример #2
0
 public void ImportNull()
 {
     ImportAwareImporter importer = new ImportAwareImporter(typeof(Thing));
     JsonRecorder writer = new JsonRecorder();
     writer.WriteNull();
     JsonReader reader = writer.CreatePlayer();
     reader.ReadToken(JsonTokenClass.Array);
     Assert.IsNull(importer.Import(new ImportContext(), reader));
 }
Пример #3
0
        public void ImportTellsObjectToImportSelf()
        {
            ImportAwareImporter importer = new ImportAwareImporter(typeof(Thing));
            JsonRecorder        writer   = new JsonRecorder();

            writer.WriteString(string.Empty);
            Thing thing = (Thing)importer.Import(new ImportContext(), writer.CreatePlayer());

            Assert.IsTrue(thing.ImportCalled);
        }
Пример #4
0
        public void ImportNull()
        {
            ImportAwareImporter importer = new ImportAwareImporter(typeof(Thing));
            JsonRecorder        writer   = new JsonRecorder();

            writer.WriteNull();
            JsonReader reader = writer.CreatePlayer();

            reader.ReadToken(JsonTokenClass.Array);
            Assert.IsNull(importer.Import(new ImportContext(), reader));
        }
Пример #5
0
 public void CannotSendNullReaderToImport()
 {
     ImportAwareImporter importer = new ImportAwareImporter(typeof(Thing));
     importer.Import(null, null);
 }
Пример #6
0
        public void CannotSendNullReaderToImport()
        {
            ImportAwareImporter importer = new ImportAwareImporter(typeof(Thing));

            importer.Import(null, null);
        }