コード例 #1
0
        public void TestAvailable()
        {
            DocumentInputStream ostream = new DocumentInputStream(_workbook_o);
            DocumentInputStream nstream = new NDocumentInputStream(_workbook_n);

            Assert.AreEqual(_workbook_size, ostream.Available());
            Assert.AreEqual(_workbook_size, nstream.Available());
            ostream.Close();
            nstream.Close();

            try
            {
                ostream.Available();
                Assert.Fail("Should have caught IOException");
            }
            catch (InvalidOperationException)
            {
                // as expected
            }
            try
            {
                nstream.Available();
                Assert.Fail("Should have caught IOException");
            }
            catch (InvalidOperationException)
            {
                // as expected
            }
        }
コード例 #2
0
        public void TestConstructor()
        {
            DocumentInputStream ostream = new DocumentInputStream(_workbook_o);
            DocumentInputStream nstream = new NDocumentInputStream(_workbook_n);

            Assert.AreEqual(_workbook_size, _workbook_o.Size);
            Assert.AreEqual(_workbook_size, _workbook_n.Size);
            Assert.AreEqual(_workbook_size, ostream.Available());
            Assert.AreEqual(_workbook_size, nstream.Available());
        }