Example #1
0
        private static topic_GET GetSingleTopicInfo(BCFTopic GivenPhysicalBCFv2)
        {
            var ReturnObject = new topic_GET();

            if (GivenPhysicalBCFv2.Markup == null)
            {
                return(ReturnObject);
            }
            ReturnObject.assigned_to = GivenPhysicalBCFv2.Markup.Topic.AssignedTo;
            if (GivenPhysicalBCFv2.Markup.Topic.BimSnippet != null)
            {
                ReturnObject.bim_snippet                  = new bim_snippet();
                ReturnObject.bim_snippet.is_external      = GivenPhysicalBCFv2.Markup.Topic.BimSnippet.isExternal;
                ReturnObject.bim_snippet.reference        = GivenPhysicalBCFv2.Markup.Topic.BimSnippet.Reference;
                ReturnObject.bim_snippet.reference_schema = GivenPhysicalBCFv2.Markup.Topic.BimSnippet.ReferenceSchema;
                ReturnObject.bim_snippet.snippet_type     = GivenPhysicalBCFv2.Markup.Topic.BimSnippet.SnippetType;
            }
            ReturnObject.creation_author = GivenPhysicalBCFv2.Markup.Topic.CreationAuthor;
            ReturnObject.creation_date   = GivenPhysicalBCFv2.Markup.Topic.CreationDate;
            ReturnObject.description     = GivenPhysicalBCFv2.Markup.Topic.Description;
            ReturnObject.guid            = GivenPhysicalBCFv2.Markup.Topic.Guid;
            ReturnObject.index           = System.Convert.ToInt32(GivenPhysicalBCFv2.Markup.Topic.Index);
            ReturnObject.labels          = GivenPhysicalBCFv2.Markup.Topic.Labels;
            ReturnObject.modified_author = GivenPhysicalBCFv2.Markup.Topic.ModifiedAuthor;
            ReturnObject.modified_date   = GivenPhysicalBCFv2.Markup.Topic.ModifiedDate;
            ReturnObject.priority        = GivenPhysicalBCFv2.Markup.Topic.Priority;
            ReturnObject.reference_link  = GivenPhysicalBCFv2.Markup.Topic.ReferenceLink;
            ReturnObject.title           = GivenPhysicalBCFv2.Markup.Topic.Title;
            ReturnObject.topic_status    = GivenPhysicalBCFv2.Markup.Topic.TopicStatus;
            ReturnObject.topic_type      = GivenPhysicalBCFv2.Markup.Topic.TopicType;
            return(ReturnObject);
        }
        public static BCFTopic CreateTopic()
        {
            var returnTopic = new BCFTopic();

            returnTopic.Markup = CreateMarkup();
            return(returnTopic);
        }
Example #3
0
        public MarkupXMLFile(XDocument xdoc)
        {
            Comments   = new List <BCFComment>();
            Viewpoints = new List <BCFViewpoint>();

            Header = new BCFHeader(xdoc.Root.Element("Header") ?? new XElement("Header"));
            Topic  = new BCFTopic(xdoc.Root.Element("Topic"));

            foreach (var comment in xdoc.Root.Elements("Comment") ?? new List <XElement> {
                new XElement("Comment")
            })
            {
                if (comment.Element("Topic") == null)
                {
                    comment.Add(new XElement("Topic", ""));
                    comment.Element("Topic").SetAttributeValue("Guid", Topic.Guid);
                }
                if (comment != null)
                {
                    Comments.Add(new BCFComment(comment));
                }
            }
            foreach (var v in xdoc.Root.Elements("Viewpoints"))
            {
                Viewpoints.Add(new BCFViewpoint(v));
            }
        }
Example #4
0
        /// <summary>
        /// </summary>
        /// <param name="expectedTopic"></param>
        /// <param name="actualTopic"></param>
        /// <param name="expectedArchive"></param>
        /// <param name="actualArchive"></param>
        /// <param name="originatesFromApiConversion">If true, Bitmaps are not compared since the API does not support them</param>
        public static void CompareSingleTopic(BCFTopic expectedTopic, BCFTopic actualTopic, ZipArchive expectedArchive, ZipArchive actualArchive, bool originatesFromApiConversion)
        {
            // Compare Markup
            CompareMarkup(expectedTopic.Markup, actualTopic.Markup, expectedArchive, actualArchive);

            // Compare SnippetData
            if (expectedTopic.SnippetData != null)
            {
                Assert.True(expectedTopic.SnippetData.SequenceEqual(actualTopic.SnippetData));
            }
            else
            {
                Assert.Null(actualTopic.SnippetData);
            }

            // Compare Viewpoints
            CompareViewpoints(expectedTopic.Viewpoints, actualTopic.Viewpoints, originatesFromApiConversion);

            // Compare ViewpointBitmaps
            if (!originatesFromApiConversion)
            {
                CompareViewpointBitmaps(expectedTopic.ViewpointBitmaps, actualTopic.ViewpointBitmaps);
            }

            // Compare ViewpointSnapshots
            CompareViewpointSnapshots(expectedTopic.ViewpointSnapshots, actualTopic.ViewpointSnapshots);
        }
Example #5
0
        public void AddviewpointSnapshotReferenceInMarkup()
        {
            var bcfTopic = new BCFTopic();

            bcfTopic.Viewpoints.Add(new VisualizationInfo());
            bcfTopic.AddOrUpdateSnapshot(bcfTopic.Viewpoints.First().GUID, new byte[] { 10, 11, 12, 13, 14, 15 });
            Assert.False(string.IsNullOrWhiteSpace(bcfTopic.Markup.Viewpoints.FirstOrDefault().Snapshot), "Reference not created for viewpoint snapshot");
        }
Example #6
0
        public static BCFTopic CreateTopic()
        {
            var returnTopic = new BCFTopic();

            returnTopic.Markup      = CreateMarkup();
            returnTopic.SnippetData = TestCaseResourceFactory.GetFileAttachment(FileAttachments.JsonElement);
            return(returnTopic);
        }
Example #7
0
        public static BCFTopic CreateTopic()
        {
            var returnTopic = new BCFTopic();

            returnTopic.Markup = CreateMarkup();
            returnTopic.Viewpoints.Add(CreateViewpoiont());
            returnTopic.AddOrUpdateSnapshot(returnTopic.Viewpoints.Last().Guid, TestCaseResourceFactory.GetViewpointSnapshot(ViewpointSnapshots.ComponentCollection_Snapshot_01));
            return(returnTopic);
        }
        public static BCFTopic CreateTopic()
        {
            var returnTopic = new BCFTopic();

            returnTopic.Markup = CreateMarkup();
            returnTopic.Viewpoints.Add(CreateViewpoiont());
            returnTopic.AddOrUpdateSnapshot(returnTopic.Viewpoints.Last().GUID, TestCaseResourceFactory.GetViewpointSnapshot(ViewpointSnapshots.PerspectiveCamera_Snapshot_01));
            return(returnTopic);
        }
        public static BCFTopic CreateTopic()
        {
            var returnTopic = new BCFTopic();

            returnTopic.Markup = CreateMarkup();
            returnTopic.Viewpoints.Add(CreateViewpoiont());
            // Using the snapshot from the perspective camera since I can't create an orthogonal camera in the viewer=)
            returnTopic.AddOrUpdateSnapshot(returnTopic.Viewpoints.Last().GUID, TestCaseResourceFactory.GetViewpointSnapshot(ViewpointSnapshots.PerspectiveCamera_Snapshot_01));
            return(returnTopic);
        }
Example #10
0
 public Topic03()
 {
     if (ReadContainer == null)
     {
         ReadContainer = TestCaseResourceFactory.GetImportTestCaseContainer(BCFv2ImportTestCases.MultipleTopics);
     }
     if (ReadTopic == null)
     {
         ReadTopic = ReadContainer.Topics.FirstOrDefault(curr => curr.Markup.Topic.Guid == "f5d76cd4-46bc-450c-a513-c1f62ac24026");
     }
 }
Example #11
0
 public Topic02()
 {
     if (ReadContainer == null)
     {
         ReadContainer = TestCaseResourceFactory.GetImportTestCaseContainer(BCFv2ImportTestCases.MultipleTopics);
     }
     if (ReadTopic == null)
     {
         ReadTopic = ReadContainer.Topics.FirstOrDefault(curr => curr.Markup.Topic.Guid == "402d5148-88ef-4510-8b9d-e632602541c6");
     }
 }
Example #12
0
 public Topic01()
 {
     if (ReadContainer == null)
     {
         ReadContainer = TestCaseResourceFactory.GetImportTestCaseContainer(BCFv2ImportTestCases.MultipleTopics);
     }
     if (ReadTopic == null)
     {
         ReadTopic = ReadContainer.Topics.FirstOrDefault(curr => curr.Markup.Topic.Guid == "33b0e849-72f1-434c-88e1-b7b3b8c27f38");
     }
 }
Example #13
0
 public Topic03()
 {
     if (ReadContainer == null)
     {
         ReadContainer = TestCaseResourceFactory.GetImportTestCaseContainer(BCFv2ImportTestCases.DecomposedObjects);
     }
     if (ReadTopic == null)
     {
         ReadTopic = ReadContainer.Topics.FirstOrDefault(curr => curr.Markup.Topic.Guid == "6da43897-f4ff-4694-97dc-fc4a43770749");
     }
 }
Example #14
0
 public Topic01()
 {
     if (ReadContainer == null)
     {
         ReadContainer = TestCaseResourceFactory.GetImportTestCaseContainer(BCFv2ImportTestCases.DecomposedObjectsWithParentGuid);
     }
     if (ReadTopic == null)
     {
         ReadTopic = ReadContainer.Topics.FirstOrDefault(curr => curr.Markup.Topic.Guid == "a23e8824-137a-4bea-a1ad-541f87d274e7");
     }
 }
Example #15
0
 public Topic01()
 {
     if (ReadContainer == null)
     {
         ReadContainer = TestCaseResourceFactory.GetImportTestCaseContainer(BCFv2ImportTestCases.SingleVisibleWall);
     }
     if (ReadTopic == null)
     {
         ReadTopic = ReadContainer.Topics.FirstOrDefault(curr => curr.Markup.Topic.Guid == "74bca551-875c-4455-adaa-2205f2245af3");
     }
 }
Example #16
0
 public Topic01()
 {
     if (ReadContainer == null)
     {
         ReadContainer = TestCaseResourceFactory.GetImportTestCaseContainerV21(BCFv21ImportTestCases.UserAssignment);
     }
     if (ReadTopic == null)
     {
         ReadTopic = ReadContainer.Topics.FirstOrDefault(curr => curr.Markup.Topic.Guid == "12628303-e7a2-4c5c-bc3c-fb088fd24077");
     }
 }
Example #17
0
        public void AddViewpointWhenThereIsNoMarkupInstance()
        {
            var bcfTopic = new BCFTopic();

            // Markup is empty
            Assert.Null(bcfTopic.Markup);
            bcfTopic.Viewpoints.Add(new VisualizationInfo());
            // Viewpoint defined
            Assert.NotNull(bcfTopic.Markup);
            Assert.Equal(bcfTopic.Markup.Viewpoints.First().Guid, bcfTopic.Viewpoints.First().GUID);
        }
Example #18
0
 public Topic01()
 {
     if (ReadContainer == null)
     {
         ReadContainer = TestCaseResourceFactory.GetImportTestCaseContainer(BCFv2ImportTestCases.Lines);
     }
     if (ReadTopic == null)
     {
         ReadTopic = ReadContainer.Topics.FirstOrDefault(curr => curr.Markup.Topic.Guid == "64124059-3964-4c0b-9987-11036e9f0d54");
     }
 }
Example #19
0
 public Topic01()
 {
     if (ReadContainer == null)
     {
         ReadContainer = TestCaseResourceFactory.GetImportTestCaseContainerV21(BCFv21ImportTestCases.RelatedTopicsWithOtherTopicMissing);
     }
     if (ReadTopic == null)
     {
         ReadTopic = ReadContainer.Topics.FirstOrDefault(curr => curr.Markup.Topic.Guid == "a6f801b9-6bf6-4cb9-8b89-1ae24b76074a");
     }
 }
Example #20
0
 public Topic01()
 {
     if (ReadContainer == null)
     {
         ReadContainer = TestCaseResourceFactory.GetImportTestCaseContainer(BCFv2ImportTestCases.DecomposedObjects);
     }
     if (ReadTopic == null)
     {
         ReadTopic = ReadContainer.Topics.FirstOrDefault(curr => curr.Markup.Topic.Guid == "eb59ce15-5713-47ed-8505-ccccd91b4170");
     }
 }
Example #21
0
 public Topic01()
 {
     if (ReadContainer == null)
     {
         ReadContainer = TestCaseResourceFactory.GetImportTestCaseContainer(BCFv2ImportTestCases.SingleInvisibleWall);
     }
     if (ReadTopic == null)
     {
         ReadTopic = ReadContainer.Topics.FirstOrDefault(curr => curr.Markup.Topic.Guid == "0425bfd9-3982-471d-b963-abd07622b191");
     }
 }
Example #22
0
 public Topic01()
 {
     if (ReadContainer == null)
     {
         ReadContainer = TestCaseResourceFactory.GetImportTestCaseContainer(BCFv2ImportTestCases.UserAssignment);
     }
     if (ReadTopic == null)
     {
         ReadTopic = ReadContainer.Topics.FirstOrDefault(curr => curr.Markup.Topic.Guid == "d83f5842-19ea-4ca9-85bf-03d4b8f504b9");
     }
 }
Example #23
0
 public Topic01()
 {
     if (ReadContainer == null)
     {
         ReadContainer = TestCaseResourceFactory.GetImportTestCaseContainerV21(BCFv21ImportTestCases.SingleVisibleWall);
     }
     if (ReadTopic == null)
     {
         ReadTopic = ReadContainer.Topics.FirstOrDefault(curr => curr.Markup.Topic.Guid == "d029895e-2bdc-4f48-8bf4-8e540425f238");
     }
 }
Example #24
0
 public Topic01()
 {
     if (ReadContainer == null)
     {
         ReadContainer = TestCaseResourceFactory.GetImportTestCaseContainer(BCFv2ImportTestCases.DefaultComponentVisibility);
     }
     if (ReadTopic == null)
     {
         ReadTopic = ReadContainer.Topics.FirstOrDefault(curr => curr.Markup.Topic.Guid == "8127b587-2b97-477e-8a82-fb5a2facd171");
     }
 }
Example #25
0
 public Topic01()
 {
     if (ReadContainer == null)
     {
         ReadContainer = TestCaseResourceFactory.GetImportTestCaseContainer(BCFv2ImportTestCases.HeaderWithSingleFile);
     }
     if (ReadTopic == null)
     {
         ReadTopic = ReadContainer.Topics.FirstOrDefault(curr => curr.Markup.Topic.Guid == "6888c011-4ea7-4025-8858-476538cb9f39");
     }
 }
Example #26
0
 public Topic01()
 {
     if (ReadContainer == null)
     {
         ReadContainer = TestCaseResourceFactory.GetImportTestCaseContainer(BCFv2ImportTestCases.MultipleFilesInHeader);
     }
     if (ReadTopic == null)
     {
         ReadTopic = ReadContainer.Topics.FirstOrDefault(curr => curr.Markup.Topic.Guid == "0656f0fb-d1d2-463d-bfb2-a31590c269fc");
     }
 }
Example #27
0
 public Topic01()
 {
     if (ReadContainer == null)
     {
         ReadContainer = TestCaseResourceFactory.GetImportTestCaseContainer(BCFv2ImportTestCases.MultipleViewpointsWithoutComments);
     }
     if (ReadTopic == null)
     {
         ReadTopic = ReadContainer.Topics.FirstOrDefault(curr => curr.Markup.Topic.Guid == "03d501f8-1025-462f-841b-35846cb36c31");
     }
 }
Example #28
0
 public Topic01()
 {
     if (ReadContainer == null)
     {
         ReadContainer = TestCaseResourceFactory.GetImportTestCaseContainer(BCFv2ImportTestCases.HeaderWithNoFiles);
     }
     if (ReadTopic == null)
     {
         ReadTopic = ReadContainer.Topics.FirstOrDefault(curr => curr.Markup.Topic.Guid == "1243de1b-2257-4d0c-8b82-ec09d5dfb350");
     }
 }
Example #29
0
 public Topic01()
 {
     if (ReadContainer == null)
     {
         ReadContainer = TestCaseResourceFactory.GetImportTestCaseContainer(BCFv2ImportTestCases.SelectedComponent);
     }
     if (ReadTopic == null)
     {
         ReadTopic = ReadContainer.Topics.FirstOrDefault(curr => curr.Markup.Topic.Guid == "9c137387-b581-4803-a85d-4931c3b42714");
     }
 }
Example #30
0
 public Topic02()
 {
     if (ReadContainer == null)
     {
         ReadContainer = TestCaseResourceFactory.GetImportTestCaseContainer(BCFv2ImportTestCases.DecomposedObjects);
     }
     if (ReadTopic == null)
     {
         ReadTopic = ReadContainer.Topics.FirstOrDefault(curr => curr.Markup.Topic.Guid == "24e5625c-8ff1-40f9-81f2-f31cfa48cf74");
     }
 }