コード例 #1
0
            public void SetsCorrectValuesForRemovedFields()
            {
                var testVersion = WarcraftVersion.Cataclysm;

                var record = new TestDBCRecord();

                record.Version = testVersion;

                using (var ms = new MemoryStream(SimpleCataBytes))
                {
                    using var br = new BinaryReader(ms);
                    DBCDeserializer.DeserializeRecord(br, record, testVersion);
                }

                Assert.AreEqual(1, record.ID);
                Assert.AreEqual(2, record.TestSimpleField);
                Assert.AreEqual(8, record.TestForeignKeyField.Key);
                Assert.AreEqual(16, record.TestNewFieldInWrath.Offset);
            }
コード例 #2
0
            public void SetsCorrectValuesForSimpleRecord()
            {
                var testVersion = WarcraftVersion.Classic;

                var record = new TestDBCRecord();

                record.Version = testVersion;

                using (var ms = new MemoryStream(SimpleClassicBytes))
                {
                    using var br = new BinaryReader(ms);
                    DBCDeserializer.DeserializeRecord(br, record, testVersion);
                }

                Assert.AreEqual(1, record.ID);
                Assert.AreEqual(2, record.TestSimpleField);
                Assert.AreEqual(4, record.TestAddedAndRemovedField);
                Assert.AreEqual(8, record.TestForeignKeyField.Key);
            }