예제 #1
0
        public void MatchConstructorArgumentAgainstReadOnlyProperty(
            string propertyName, string parameterName, bool expected)
        {
            var prop = new PropertyInfoElement(
                typeof(Version).GetProperty(propertyName));
            var param = new ParameterInfoElement(
                typeof(Version)
                .GetConstructor(new[] { typeof(int), typeof(int) })
                .GetParameters()
                .Where(p => p.Name == parameterName)
                .Single());

            var actual =
                new SemanticElementComparer(new SemanticReflectionVisitor())
                .Equals(prop, param);

            Assert.Equal(expected, actual);
        }
예제 #2
0
        public void MatchContructorArgumentAgainstReadOnlyProperty(
            string propertyName, string parameterName, bool expected)
        {
            var prop = new PropertyInfoElement(
                typeof(Version).GetProperty(propertyName));
            var param = new ParameterInfoElement(
                typeof(Version)
                    .GetConstructor(new[] { typeof(int), typeof(int) })
                    .GetParameters()
                    .Where(p => p.Name == parameterName)
                    .Single());

            var actual =
                new SemanticElementComparer(new SemanticReflectionVisitor())
                    .Equals(prop, param);

            Assert.Equal(expected, actual);
        }