//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public void testWrapping() throws Exception public virtual void testWrapping() { CharFilter cs = new TestRandomChains.CheckThatYouDidntReadAnythingReaderWrapper(wrappedStream); try { cs.mark(1); fail(); } catch (Exception e) { assertEquals("mark(int)", e.Message); } try { cs.markSupported(); fail(); } catch (Exception e) { assertEquals("markSupported()", e.Message); } try { cs.read(); fail(); } catch (Exception e) { assertEquals("read()", e.Message); } try { cs.read(new char[0]); fail(); } catch (Exception e) { assertEquals("read(char[])", e.Message); } try { cs.read(CharBuffer.wrap(new char[0])); fail(); } catch (Exception e) { assertEquals("read(CharBuffer)", e.Message); } try { cs.reset(); fail(); } catch (Exception e) { assertEquals("reset()", e.Message); } try { cs.skip(1); fail(); } catch (Exception e) { assertEquals("skip(long)", e.Message); } try { cs.correctOffset(1); fail(); } catch (Exception e) { assertEquals("correct(int)", e.Message); } try { cs.close(); fail(); } catch (Exception e) { assertEquals("close()", e.Message); } try { cs.read(new char[0], 0, 0); fail(); } catch (Exception e) { assertEquals("read(char[], int, int)", e.Message); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public void testWrapping() throws Exception public virtual void testWrapping() { CharFilter cs = new TestRandomChains.CheckThatYouDidntReadAnythingReaderWrapper(wrappedStream); try { cs.mark(1); fail(); } catch (Exception e) { assertEquals("mark(int)", e.Message); } try { cs.markSupported(); fail(); } catch (Exception e) { assertEquals("markSupported()", e.Message); } try { cs.read(); fail(); } catch (Exception e) { assertEquals("read()", e.Message); } try { cs.read(new char[0]); fail(); } catch (Exception e) { assertEquals("read(char[])", e.Message); } try { cs.read(CharBuffer.wrap(new char[0])); fail(); } catch (Exception e) { assertEquals("read(CharBuffer)", e.Message); } try { cs.reset(); fail(); } catch (Exception e) { assertEquals("reset()", e.Message); } try { cs.skip(1); fail(); } catch (Exception e) { assertEquals("skip(long)", e.Message); } try { cs.correctOffset(1); fail(); } catch (Exception e) { assertEquals("correct(int)", e.Message); } try { cs.close(); fail(); } catch (Exception e) { assertEquals("close()", e.Message); } try { cs.read(new char[0], 0, 0); fail(); } catch (Exception e) { assertEquals("read(char[], int, int)", e.Message); } }
public virtual void TestWrapping() { CharFilter cs = new TestRandomChains.CheckThatYouDidntReadAnythingReaderWrapper(wrappedStream); try { cs.Mark(1); fail(); } catch (Exception e) { assertEquals("Mark(int)", e.Message); } try { var supported = cs.IsMarkSupported; fail(); } catch (Exception e) { assertEquals("IsMarkSupported", e.Message); } try { cs.Read(); fail(); } catch (Exception e) { assertEquals("Read()", e.Message); } try { cs.read(new char[0]); fail(); } catch (Exception e) { // LUCENENET NOTE: TextReader doesn't support an overload that doesn't supply // index and count. We have an extension method that does in test environment, // but the error will be for the cascaded overload //assertEquals("Read(char[])", e.Message); assertEquals("Read(char[], int, int)", e.Message); } // LUCENENET NOTE: We don't have a CharBuffer type in Lucene.Net, // nor do we have an overload that accepts it. //try //{ // cs.read(CharBuffer.wrap(new char[0])); // fail(); //} //catch (Exception e) //{ // assertEquals("Read(CharBuffer)", e.Message); //} try { cs.Reset(); fail(); } catch (Exception e) { assertEquals("Reset()", e.Message); } try { cs.Skip(1); fail(); } catch (Exception e) { assertEquals("Skip(long)", e.Message); } try { cs.CorrectOffset(1); fail(); } catch (Exception e) { assertEquals("Correct(int)", e.Message); } try { cs.Close(); fail(); } catch (Exception e) { assertEquals("Close()", e.Message); } try { cs.Read(new char[0], 0, 0); fail(); } catch (Exception e) { assertEquals("Read(char[], int, int)", e.Message); } }