コード例 #1
0
        public void UnionsOfDifferentRecordTypesShouldBeAllowed()
        {
            var unionSchema = new UnionSchema(Schema.Create(typeof(Person)), Schema.Create(typeof(Car)));

            var fromJsonSchema = Schema.Create(unionSchema.ToString());

            Assert.NotNull(fromJsonSchema);
        }
コード例 #2
0
        public void UnionsOfSameTypeShouldThrowException(Type type)
        {
            var unionSchema = new UnionSchema(Schema.Create(type), Schema.Create(type));

            Assert.ThrowsAny <Exception>(() =>
                                         Schema.Create(unionSchema.ToString())
                                         );
        }