コード例 #1
0
        public void GetPropertyValue_String()
        {
            // Act
            var actual = EnumAttributeHelper.GetPropertyValue <TestEnum, SimpleAttribute, string>(TestEnum.Value3, attribute => attribute.MyString);

            // Assert
            actual.ShouldHaveSameValueAs("d");
        }
コード例 #2
0
 public void GetPropertyValue_String_NoAttributeDefined()
 {
     // Act
     EnumAttributeHelper.GetPropertyValue <TestEnum, SimpleAttribute, string>(TestEnum.Value1, attribute => attribute.MyString);
 }
コード例 #3
0
 public void GetPropertyValue_String_NullPropertyExpression()
 {
     // Act
     EnumAttributeHelper.GetPropertyValue <TestEnum, SimpleAttribute, string>(TestEnum.Value3, null);
 }
コード例 #4
0
 public void GetPropertyValue_String_NotAnEnum()
 {
     // Act
     EnumAttributeHelper.GetPropertyValue <SimpleStruct, SimpleAttribute, string>(new SimpleStruct(), null);
 }