//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void initializeThrowsForNullConfig() public virtual void InitializeThrowsForNullConfig() { DeferringStatementLocksFactory factory = new DeferringStatementLocksFactory(); try { factory.Initialize(mock(typeof(Locks)), null); fail("Exception expected"); } catch (Exception e) { assertThat(e, instanceOf(typeof(System.NullReferenceException))); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void newInstanceCreatesDeferredLocksWhenConfigSet() public virtual void NewInstanceCreatesDeferredLocksWhenConfigSet() { Locks locks = mock(typeof(Locks)); Locks_Client client = mock(typeof(Locks_Client)); when(locks.NewClient()).thenReturn(client); Config config = Config.defaults(deferred_locks_enabled, Settings.TRUE); DeferringStatementLocksFactory factory = new DeferringStatementLocksFactory(); factory.Initialize(locks, config); StatementLocks statementLocks = factory.NewInstance(); assertThat(statementLocks, instanceOf(typeof(DeferringStatementLocks))); assertThat(statementLocks.Optimistic(), instanceOf(typeof(DeferringLockClient))); assertSame(client, statementLocks.Pessimistic()); }