예제 #1
0
        public void Should_return_null_if_not_match_anything()
        {
            // Arrange
            var matcher = new MethodMatcher();
            var request = new RpcRequest
            {
                DeclaringType = typeof(ISomeService).FullName,
                MethodName = "MethodNotFound",
                MemberType = MemberTypes.Method,
                MethodSignature = matcher.GetMethodSignature(new DynamicMethod("MethodNotFound", typeof(void), null, true))
            };

            // Action
            var method = matcher.Match<ISomeService>(request);

            // Assert
            Assert.IsNull(method);
        }
예제 #2
0
        public void Should_return_null_if_not_match_anything()
        {
            // Arrange
            var matcher = new MethodMatcher();
            var request = new RpcRequest
            {
                DeclaringType   = typeof(ISomeService).FullName,
                MethodName      = "MethodNotFound",
                MemberType      = MemberTypes.Method,
                MethodSignature = matcher.GetMethodSignature(new DynamicMethod("MethodNotFound", typeof(void), null, true))
            };

            // Action
            var method = matcher.Match <ISomeService>(request);

            // Assert
            Assert.IsNull(method);
        }
예제 #3
0
        public void Should_return_method_info_if_match()
        {
            // Arrange
            var matcher = new MethodMatcher();
            var request = new RpcRequest
            {
                DeclaringType = typeof(ISomeService).FullName,
                MethodName = "TryParse",
                MemberType = MemberTypes.Method,
                MethodSignature = matcher.GetMethodSignature(typeof(ISomeService).GetMethod("TryParse"))
            };

            // Action
            var method = matcher.Match<ISomeService>(request);

            // Assert
            Assert.IsNotNull(method);
        }
예제 #4
0
        public void Should_return_method_info_if_match()
        {
            // Arrange
            var matcher = new MethodMatcher();
            var request = new RpcRequest
            {
                DeclaringType   = typeof(ISomeService).FullName,
                MethodName      = "TryParse",
                MemberType      = MemberTypes.Method,
                MethodSignature = matcher.GetMethodSignature(typeof(ISomeService).GetMethod("TryParse"))
            };

            // Action
            var method = matcher.Match <ISomeService>(request);

            // Assert
            Assert.IsNotNull(method);
        }