Example #1
0
        public void GetSupportedMethod_WithExactMatch_ReturnsMethod()
        {
            var expectedMethod = typeof(Generic <,>).GetMethod("NonAmbiguousMethod");

            var result = TestableMethodCallExpressionNodeBase.GetSupportedMethod(() => ((Generic <int, string>)null).NonAmbiguousMethod(0));

            Assert.That(result, Is.SameAs(expectedMethod));
        }
Example #2
0
 public void GetSupportedMethod_WithAmbiguousMatch_ThrowsNotSupportedException()
 {
     Assert.That(
         () => TestableMethodCallExpressionNodeBase.GetSupportedMethod(() => ((Generic <int, string>)null).AmbiguousMethod(0)),
         Throws.TypeOf <NotSupportedException>());
 }