Example #1
0
        public void CraftingTabList_Serialize_Deserialize()
        {
            var tabList = new CustomCraftingTabList
            {
                new CustomCraftingTab
                {
                    TabID         = "CustomTab1",
                    DisplayName   = "Custom Tab The First",
                    ParentTabPath = "CyclopsFabricator/OriginalTab_1",
                    SpriteItemID  = TechType.Cyclops
                },
                new CustomCraftingTab
                {
                    TabID         = "CustomTab2",
                    DisplayName   = "Custom Tab The Second",
                    ParentTabPath = "SeamothUpgrades/OriginalTab_2",
                    SpriteItemID  = TechType.Seamoth
                },
            };

            string serialized = tabList.PrettyPrint();

            Console.WriteLine(serialized);

            var tabList2 = new CustomCraftingTabList();

            tabList2.FromString(serialized);

            Assert.AreEqual(tabList, tabList2);
            Assert.IsTrue(tabList.Equals(tabList2));
            Assert.IsTrue(tabList == tabList2);
        }
Example #2
0
        public void Sample_CustomTabs_Ok()
        {
            var cTabs = new CustomCraftingTabList();

            string sample = File.ReadAllText(SampleFileDirectory + "CustomTab_Samples.txt");

            bool result = cTabs.FromString(sample);

            Assert.IsTrue(result);
        }