public void AttributeCloner_Throws_IfAppSettingAndAutoResolve()
        {
            InvalidAnnotation a = new InvalidAnnotation();
            var exc             = Assert.Throws <InvalidOperationException>(() => new AttributeCloner <InvalidAnnotation>(a, emptyContract));

            Assert.Equal("Property 'Required' cannot be annotated with both AppSetting and AutoResolve.", exc.Message);
        }
示例#2
0
        public void AttributeCloner_Throws_IfAppSettingAndAutoResolve()
        {
            InvalidAnnotation a = new InvalidAnnotation();
            var exc             = Assert.Throws <InvalidOperationException>(() => new AttributeCloner <InvalidAnnotation>(a, emptyContract, _emptyConfig));

            Assert.Equal("Property 'Required' can only be annotated with one of the types AppSettingAttribute, AutoResolveAttribute, and ConnectionStringAttribute.", exc.Message);
        }