예제 #1
0
        public void GetAttribute_OneMatch_IsReturned()
        {
            var attr1 = new WormColumnNameAttribute("attr1");
            this.pi.Setup(xx => xx.GetCustomAttributes(typeof(WormColumnNameAttribute), true)).Returns(new object[]{attr1});

            Assert.AreSame(attr1, this.property.GetAttribute<WormColumnNameAttribute>());
        }
예제 #2
0
        public void Parse_ColumnNameIsSet_HasAttribute()
        {
            var attr = new WormColumnNameAttribute("das_column");
            this.property.Setup(xx => xx.GetAttribute<WormColumnNameAttribute>()).Returns(attr);

            this.propToEntity.Parse(this.property.Object);

            this.pocoField.VerifySet(xx => xx.ColumnName = It.Is<string>(actual => "das_column".Equals(actual)), Times.Once);
        }