public void NArgAttribute_ProtectedCopyConstructorWorkWithValidValues_DoesNotThrow() { object nattr = CustomAttributeHelper.GetCustomPropertiesFromMember <AttributeTests, NArgAttribute>( "NArgAttribute_ProtectedCopyConstructorWorkWithValidValues_DoesNotThrow"); GoodInheritFromNArgAttribute good = new GoodInheritFromNArgAttribute((NArgAttribute)nattr); Assert.That(good.AltName, Is.EqualTo("somethingelse")); Assert.That(good.IsOptional, Is.True); Assert.That(good.Rank, Is.EqualTo(5)); Assert.That(good.AllowedValues, Is.EqualTo(new string[] { "1", "2", "3" })); Assert.That(good.OptionalArgName, Is.EqualTo("avalue")); }
public void NArgAttribute_CanSetAltNamePropertyOnAPropertyMember_IsBar() { Assert.That(CustomAttributeHelper.GetCustomPropertiesFromMember <Sample, NArgAttribute>("Foo"), Has.Property("AltName").EqualTo("Bar")); }
public void MemberAttribute_WhenOptionalSetWithAllowedValuesAndOptionalArgNameNotSet_HasOptionalArgumentIsTrue() { NArgAttribute nattr = (NArgAttribute)CustomAttributeHelper.GetCustomPropertiesFromMember <Sample, NArgAttribute>("_limitedValues"); Assert.That(nattr.HasOptionalArgument, Is.True); }
public void NArgAttribute_CanSetRankPropertyOnADataMember_Is7() { Assert.That(CustomAttributeHelper.GetCustomPropertiesFromMember <Sample, NArgAttribute>("_one"), Has.Property("Rank").EqualTo(7)); }