public void ReadLumpInfoDisposed()
        {
            var reader = new BspReader(MAP_FILENAME);

            reader.Dispose();
            reader.ReadLumpInfo(0);
        }
        public void ReadLumpInfoById()
        {
            var r    = new BspReader(MAP_FILENAME);
            var lump = r.ReadLumpInfo(40);

            r.Dispose();

            Assert.IsInstanceOfType(lump, typeof(BspLumpInfo));
            Assert.IsNotNull(lump);
        }
Example #3
0
        public void WriteAndValidateLumpInfo()
        {
            WriteLumpInfo();

            var reader       = new BspReader(TEMP_FILENAME);
            var tempLumpInfo = reader.ReadLumpInfo(0);

            reader.Dispose();

            Assert.AreEqual(tempLumpInfo, exampleLump);
        }
        public void ReadLumpInfoDisposedMessage()
        {
            var reader = new BspReader(MAP_FILENAME);

            reader.Dispose();
            try
            {
                reader.ReadLumpInfo(0);
                Assert.Fail();
            }
            catch (Exception ex)
            {
                Assert.AreEqual(ex.Message, exceptionMessage);
            }
        }
        public void ReadInCustomOrder()
        {
            var reader    = new BspReader(MAP_FILENAME);
            var reference = reader.ReadInfo();

            reader.Dispose();

            reader = new BspReader(MAP_FILENAME);
            var meaninglessVar = reader.ReadLumpInfo(BspLumpType.LUMP_PAKFILE);
            var tested         = reader.ReadInfo();

            reader.Dispose();

            Assert.AreEqual(reference, tested);
        }