Ejemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldFormatErrorForRecord()
        internal virtual void ShouldFormatErrorForRecord()
        {
            // when
            _logger.error(RecordType.NEO_STORE, new NeoStoreRecord(), "sample message", 1, 2);

            // then
            _logProvider.assertExactly(_inlog.error(Join("sample message", NeoStoreRecord(true, -1), "Inconsistent with: 1 2")));
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldLogJobFailure() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldLogJobFailure()
        {
            // Given
            CreateNode(map(_name, "irrelephant"), _first);
            AssertableLogProvider logProvider = new AssertableLogProvider();
            FlippableIndexProxy   index       = mock(typeof(FlippableIndexProxy));
            IndexPopulator        populator   = spy(IndexPopulator(false));
            IndexPopulationJob    job         = NewIndexPopulationJob(populator, index, _indexStoreView, logProvider, EntityType.NODE, IndexDescriptor(_first, _name, false));

            Exception failure = new System.InvalidOperationException("not successful");

            doThrow(failure).when(populator).create();

            // When
            job.Run();

            // Then
            AssertableLogProvider.LogMatcherBuilder match = inLog(typeof(IndexPopulationJob));
            logProvider.AssertAtLeastOnce(match.error(@is("Failed to populate index: [:FIRST(name)]"), sameInstance(failure)));
        }