public void TestAutoD2XXLLevelLoad()
        {
            var hogFile = new HOGFile(TestUtils.GetResourceStream("d2x-xl.hog"));
            //TODO: Magic number
            ILevel level = LevelFactory.CreateFromStream(hogFile.GetLumpAsStream(6));

            Assert.NotNull(level);
            Assert.IsInstanceOf <D2XXLLevel>(level);
        }
        public void TestAutoD1LevelLoad()
        {
            ILevel level = null;

            using (var stream = TestUtils.GetResourceStream("test.rdl"))
            {
                level = LevelFactory.CreateFromStream(stream);
            }
            Assert.NotNull(level);
            Assert.IsInstanceOf <D1Level>(level);
        }
Пример #3
0
        public void TestLumpData()
        {
            var hogFile    = new HOGFile(TestUtils.GetResourceStream("standard.hog"));
            var lumpHeader = hogFile.Lumps[2];

            var lumpData = hogFile.GetLumpData(2);

            Assert.NotNull(lumpData);
            Assert.AreEqual(lumpHeader.Size, lumpData.Length);

            var lumpStream = hogFile.GetLumpAsStream(2);

            Assert.NotNull(lumpStream);
            Assert.AreEqual(lumpHeader.Size, lumpStream.Length);

            // One last thing... try reading the stream
            var level = LevelFactory.CreateFromStream(lumpStream);

            Assert.NotNull(level);
            Assert.AreEqual(20, level.Segments.Count);
        }