Ejemplo n.º 1
0
        public void TestParseCampaignObjectData(string campaignObjectDataFilePath)
        {
            using var original  = FileProvider.GetFile(campaignObjectDataFilePath);
            using var recreated = new MemoryStream();

            CampaignObjectData.Parse(original, true).SerializeTo(recreated, true);
            StreamAssert.AreEqual(original, recreated, true);
        }
Ejemplo n.º 2
0
        public void TestCreateNewObjectData()
        {
            var objectData = new CampaignObjectData(
                new CampaignUnitObjectData(Array.Empty <ObjectModification>()),
                new CampaignItemObjectData(Array.Empty <ObjectModification>()),
                new CampaignDestructableObjectData(Array.Empty <ObjectModification>()),
                new CampaignDoodadObjectData(Array.Empty <ObjectModification>()),
                new CampaignAbilityObjectData(Array.Empty <ObjectModification>()),
                new CampaignBuffObjectData(Array.Empty <ObjectModification>()),
                new CampaignUpgradeObjectData(Array.Empty <ObjectModification>()));

            using var memoryStream = new MemoryStream();
            objectData.SerializeTo(memoryStream, true);

            memoryStream.Position = 0;
            CampaignObjectData.Parse(memoryStream);
        }