示例#1
0
        public void ShouldIgnoreASetMethod()
        {
            var member = MemberCache
                         .GetSourceMembers(typeof(PublicSetMethod <short>))
                         .FirstOrDefault(m => m.Name == "Value");

            member.ShouldBeNull();
        }
示例#2
0
        public void ShouldIgnoreGetType()
        {
            var member = MemberCache
                         .GetSourceMembers(typeof(PublicProperty <int?>))
                         .FirstOrDefault(m => m.Name == "GetType");

            member.ShouldBeNull();
        }
示例#3
0
        public void ShouldIgnoreAWriteOnlyPublicProperty()
        {
            var member = MemberCache
                         .GetSourceMembers(typeof(PublicWriteOnlyProperty <long>))
                         .FirstOrDefault(m => m.Name == "Value");

            member.ShouldBeNull();
        }
示例#4
0
        public void ShouldIgnoreANonPublicField()
        {
            var member = MemberCache
                         .GetSourceMembers(typeof(InternalField <byte>))
                         .FirstOrDefault(m => m.Name == "Value");

            member.ShouldBeNull();
        }
示例#5
0
        public void ShouldFindARootArrayElement()
        {
            var member = MemberCache
                         .GetSourceMembers(typeof(int[]))
                         .FirstOrDefault();

            member.ShouldNotBeNull();
        }
示例#6
0
        public void ShouldIgnoreAPropertyGetter()
        {
            var member = MemberCache
                         .GetSourceMembers(typeof(PublicProperty <string>))
                         .FirstOrDefault(m => m.Name.StartsWith("get_"));

            member.ShouldBeNull();
        }
示例#7
0
        public void ShouldFindAPublicGetMethod()
        {
            var member = MemberCache
                         .GetSourceMembers(typeof(PublicGetMethod <DateTime>))
                         .FirstOrDefault(m => m.Name == "GetValue");

            member.ShouldNotBeNull();
            member.Type.ShouldBe(typeof(DateTime));
        }
示例#8
0
        public void ShouldFindAPublicField()
        {
            var member = MemberCache
                         .GetSourceMembers(typeof(PublicField <int>))
                         .FirstOrDefault(m => m.Name == "Value");

            member.ShouldNotBeNull();
            member.Type.ShouldBe(typeof(int));
        }
示例#9
0
        public void ShouldFindAPublicProperty()
        {
            var member = MemberCache
                         .GetSourceMembers(typeof(PublicProperty <string>))
                         .FirstOrDefault(m => m.Name == "Value");

            member.ShouldNotBeNull();
            member.Type.ShouldBe(typeof(string));
        }