public virtual void TestResourceCleanup() { CloseCheckInputStream affixStream = new CloseCheckInputStream(this, this.GetType().getResourceAsStream("compressed.aff")); CloseCheckInputStream dictStream = new CloseCheckInputStream(this, this.GetType().getResourceAsStream("compressed.dic")); new Dictionary(affixStream, dictStream); assertFalse(affixStream.Disposed); assertFalse(dictStream.Disposed); affixStream.Dispose(); dictStream.Dispose(); assertTrue(affixStream.Disposed); assertTrue(dictStream.Disposed); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public void testResourceCleanup() throws Exception public virtual void testResourceCleanup() { CloseCheckInputStream affixStream = new CloseCheckInputStream(this, this.GetType().getResourceAsStream("compressed.aff")); CloseCheckInputStream dictStream = new CloseCheckInputStream(this, this.GetType().getResourceAsStream("compressed.dic")); new Dictionary(affixStream, dictStream); assertFalse(affixStream.Closed); assertFalse(dictStream.Closed); affixStream.close(); dictStream.close(); assertTrue(affixStream.Closed); assertTrue(dictStream.Closed); }