public void TestSaveSWComponentsList(string modelName)
        {
            ModelDoc2   doc     = OpenSWDocument(modelName);
            AssemblyDoc assyDoc = (AssemblyDoc)doc;

            object[]          componentObjs = assyDoc.GetComponents(false);
            List <Component2> components    = componentObjs.Cast <Component2>().ToList();
            List <byte[]>     pids          = CommonSwOperations.SaveSWComponents(doc, components);

            Assert.Equal(pids.Count, components.Count);

            SwApp.CloseAllDocuments(true);
        }
        public void TestSaveSWComponentsLink(string modelName)
        {
            ModelDoc2 doc      = OpenSWDocument(modelName);
            LinkNode  baseNode = ConfigurationSerialization.LoadBaseNodeFromModel(doc, out bool abortProcess);

            Assert.False(abortProcess);

            List <string> problemLinks = new List <string>();

            CommonSwOperations.LoadSWComponents(doc, baseNode, problemLinks);
            Assert.Empty(problemLinks);

            Link baseLink = baseNode.RebuildLink();

            baseLink.SWMainComponent = baseLink.SWComponents[0];
            CommonSwOperations.SaveSWComponents(doc, baseLink);
            Assert.Equal(baseLink.SWComponents.Count, baseLink.SWComponentPIDs.Count);
            Assert.NotNull(baseLink.SWMainComponentPID);

            SwApp.CloseAllDocuments(true);
        }