예제 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testVisit() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void TestVisit()
        {
            Command cmd = mock(typeof(Command));

            // WHEN
            bool result = _facade.visit(cmd);

            // THEN
            InOrder inOrder = inOrder(cmd);

            inOrder.verify(cmd).handle(_txApplier1);
            inOrder.verify(cmd).handle(_txApplier2);
            inOrder.verify(cmd).handle(_txApplier3);

            inOrder.verifyNoMoreInteractions();

            assertFalse(result);
        }
예제 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldRecreateSchemaRuleWhenDeleteCommandReadFromDisk() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldRecreateSchemaRuleWhenDeleteCommandReadFromDisk()
        {
            // GIVEN
            SchemaRecord beforeRecords = Serialize(_rule, _id, true, true);
            SchemaRecord afterRecords  = Serialize(_rule, _id, false, false);

            Command.SchemaRuleCommand command = new Command.SchemaRuleCommand(beforeRecords, afterRecords, _rule);
            InMemoryClosableChannel   buffer  = new InMemoryClosableChannel();

            when(_neoStores.SchemaStore).thenReturn(_schemaStore);

            // WHEN
            command.Serialize(buffer);
            Command readCommand = _reader.read(buffer);

            // THEN
            assertThat(readCommand, instanceOf(typeof(Command.SchemaRuleCommand)));

            AssertSchemaRule((Command.SchemaRuleCommand)readCommand);
        }