Esempio n. 1
0
        /// <summary>
        /// Register a new function defined with annotations on a java class. </summary>
        /// <param name="func"> the function class </param>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void registerFunction(Class func, boolean overrideCurrentImplementation) throws org.neo4j.internal.kernel.api.exceptions.KernelException
        public virtual void RegisterFunction(Type func, bool overrideCurrentImplementation)
        {
            foreach (CallableUserFunction function in _compiler.compileFunction(func))
            {
                Register(function, overrideCurrentImplementation);
            }
        }
Esempio n. 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldInjectLogging() throws org.neo4j.internal.kernel.api.exceptions.KernelException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldInjectLogging()
        {
            // Given
            Log log = spy(typeof(Log));

            _components.register(typeof(Log), ctx => log);
            CallableUserFunction function = _procedureCompiler.compileFunction(typeof(LoggingFunction))[0];

            // When
            function.Apply(new BasicContext(), new AnyValue[0]);

            // Then
            verify(log).debug("1");
            verify(log).info("2");
            verify(log).warn("3");
            verify(log).error("4");
        }