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

            importer.Import(null, null);
        }