Ejemplo n.º 1
0
        public void TryAutoResolveValue_UnresolvedValue_ThrowsExpectedException()
        {
            var resolver  = new FakeNameResolver();
            var attribute = new Attr2(string.Empty, string.Empty)
            {
                ResolvedSetting = "MySetting"
            };
            var    prop          = attribute.GetType().GetProperty("ResolvedSetting");
            string resolvedValue = null;

            var ex = Assert.Throws <InvalidOperationException>(() => AttributeCloner <Attr2> .TryAutoResolveValue(attribute, prop, resolver, out resolvedValue));

            Assert.Equal("Unable to resolve value for property 'Attr2.ResolvedSetting'.", ex.Message);
        }