protected void AssertNotSupportedMethods_ByName <T> (IEnumerable <NameBasedRegistrationInfo> supportedMethodNames, params Expression <Func <T> >[] methodExpressions) { var nameBasedRegistry = new MethodNameBasedNodeTypeRegistry(); nameBasedRegistry.Register(supportedMethodNames, typeof(object)); foreach (var methodExpression in methodExpressions) { var methodInfo = ((MethodCallExpression)methodExpression.Body).Method; Assert.That( nameBasedRegistry.GetNodeType(methodInfo), Is.Null, string.Format("Method '{0}.{1}' is supported.", methodInfo.DeclaringType.Name, methodInfo.Name)); } }
public void Register() { Assert.That(_registry.RegisteredNamesCount, Is.EqualTo(0)); _registry.Register(new[] { new NameBasedRegistrationInfo("Test", mi => true) }, typeof(SelectExpressionNode)); Assert.That(_registry.RegisteredNamesCount, Is.EqualTo(1)); }