Example #1
0
        public void Resolver_GetKnownTypesUsingDataContractResolverWithNull()
        {
            var resolver = new AvroDataContractResolver();

            Assert.ThrowsException <ArgumentNullException>(() => resolver.GetKnownTypes(null));
        }
Example #2
0
        public void Resolver_GetKnownTypesUsingDataContractResolverWithNull()
        {
            var resolver = new AvroDataContractResolver();

            resolver.GetKnownTypes(null);
        }
 public void Resolver_GetKnownTypesUsingDataContractResolverWithNull()
 {
     var resolver = new AvroDataContractResolver();
     resolver.GetKnownTypes(null);
 }
        public void Resolver_GetKnownTypesUsingDataContactResolverForAbstractClassAndValidTypes()
        {
            var resolver = new AvroDataContractResolver();
            var knownTypes = resolver.GetKnownTypes(typeof(AbstractShape)).ToList();

            Assert.AreEqual(2, knownTypes.Count);
            Assert.IsTrue(
                (knownTypes[0] == typeof(Square) && knownTypes[1] == typeof(Rectangle)) ||
                (knownTypes[1] == typeof(Square) && knownTypes[0] == typeof(Rectangle)));
        }
 public void Resolver_GetKnownTypesUsingDataContactResolverForAbstractClassAndInvalidTypes()
 {
     var resolver = new AvroDataContractResolver();
     var knownTypes = resolver.GetKnownTypes(typeof(AbstractClassWithInvalidKnownTypes));
     Assert.IsTrue(knownTypes.SequenceEqual(new[] { typeof(Rectangle) }));
 }