예제 #1
0
        public void AddEmptyField()
        {
            var record = new RecordSchema("TestRecord");

            Assert.Throws(typeof(AvroParseException), () => record.Add(null));
            Assert.Throws(typeof(AvroParseException), () => record.Add(new RecordSchema.Field()));
        }
예제 #2
0
        public void AddDuplicateField()
        {
            var record = new RecordSchema("TestRecord");
            var field  = new RecordSchema.Field("TestField");

            record.Add(field);
            Assert.Throws(typeof(AvroParseException), () => record.Add(field));
        }
예제 #3
0
        public void RemoveField()
        {
            var record = new RecordSchema("TestRecord");
            var field  = new RecordSchema.Field("TestField");

            record.Add(field);
            Assert.IsFalse(record.Remove("X"));
            Assert.IsTrue(record.Remove(field.Name));
            Assert.IsEmpty(record);
        }
예제 #4
0
 public SchemaSource()
 {
     _recordSchemaRecurse.Add(
         new RecordSchema.Field()
     {
         Name = "Recurse",
         Type = _recordSchemaRecurse
     }
         );
 }