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);
 }
 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));
 }
        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);
        }
        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));
        }
 public void CannotSendNullReaderToImport()
 {
     ImportAwareImporter importer = new ImportAwareImporter(typeof(Thing));
     importer.Import(null, null);
 }
        public void CannotSendNullReaderToImport()
        {
            ImportAwareImporter importer = new ImportAwareImporter(typeof(Thing));

            importer.Import(null, null);
        }