Example #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings("unchecked") private org.neo4j.storageengine.api.StorageReader prepareStorageReaderMock(java.util.List<org.neo4j.internal.kernel.api.schema.constraints.ConstraintDescriptor> descriptors)
        private StorageReader PrepareStorageReaderMock(IList <ConstraintDescriptor> descriptors)
        {
            StorageReader storageReader = Mockito.mock(typeof(StorageReader));

            when(storageReader.ConstraintsGetAll()).thenReturn(descriptors.GetEnumerator());
            when(storageReader.GetOrCreateSchemaDependantState(eq(typeof(PropertyExistenceEnforcer)), any(typeof(System.Func)))).thenAnswer(invocation =>
            {
                Function <StorageReader, PropertyExistenceEnforcer> function = invocation.getArgument(1);
                return(function.apply(storageReader));
            });
            return(storageReader);
        }