Esempio n. 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void compiledOutputCreatesInputTrace() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void CompiledOutputCreatesInputTrace()
        {
            // GIVEN
            StringBuilder output = new StringBuilder();
            InvocationTracer <DbStructureVisitor> tracer = new InvocationTracer <DbStructureVisitor>("Test", _packageName, _className, typeof(DbStructureVisitor), DbStructureArgumentFormatter.Instance, output);

            ExerciseVisitor(from => tracer.NewProxy());
            tracer.Close();
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.neo4j.helpers.collection.Visitable<DbStructureVisitor> visitable = compileVisitable(classNameWithPackage, output.toString());
            Visitable <DbStructureVisitor> visitable = CompileVisitable(_classNameWithPackage, output.ToString());
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final DbStructureVisitor visitor = mock(DbStructureVisitor.class);
            DbStructureVisitor visitor = mock(typeof(DbStructureVisitor));

            // WHEN
            visitable.Accept(visitor);

            // THEN
            ExerciseVisitor(o => verify(visitor));
            verifyNoMoreInteractions(visitor);
        }
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 compiledOutputProducesSameCompiledOutputIfCompiledAgain() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void CompiledOutputProducesSameCompiledOutputIfCompiledAgain()
        {
            // GIVEN
            StringBuilder output1 = new StringBuilder();
            InvocationTracer <DbStructureVisitor> tracer1 = new InvocationTracer <DbStructureVisitor>("Test", _packageName, _className, typeof(DbStructureVisitor), DbStructureArgumentFormatter.Instance, output1);
            DbStructureVisitor visitor1 = tracer1.NewProxy();

            ExerciseVisitor(from => visitor1);
            tracer1.Close();
            string source1 = output1.ToString();
            Visitable <DbStructureVisitor> visitable = CompileVisitable(_classNameWithPackage, source1);

            // WHEN
            StringBuilder output2 = new StringBuilder();
            InvocationTracer <DbStructureVisitor> tracer2 = new InvocationTracer <DbStructureVisitor>("Test", _packageName, _className, typeof(DbStructureVisitor), DbStructureArgumentFormatter.Instance, output2);
            DbStructureVisitor visitor2 = tracer2.NewProxy();

            visitable.Accept(visitor2);
            tracer2.Close();
            string source2 = output2.ToString();

            // THEN
            assertEquals(source1, source2);
        }