-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7aa1914
commit 0257af7
Showing
9 changed files
with
58 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,10 @@ | |
using System.Collections.Concurrent; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using bcf21 = bcf.bcf21; | ||
using bcf30 = bcf.bcf30; | ||
using bcf.Converter; | ||
using bcf21 = BcfConverter.Model.Bcf21; | ||
using bcf30 = BcfConverter.Model.Bcf30; | ||
using BcfConverter; | ||
using BcfConverter.Model; | ||
using NUnit.Framework; | ||
|
||
namespace Tests.Converter.Bcf; | ||
|
@@ -19,7 +20,7 @@ public class BcfConverterTests { | |
[Category("BCF v2.1")] | ||
public async Task ParseBcfAllPartsVisibleTest() { | ||
var markups = | ||
await BcfConverter.ParseMarkups<bcf21.Markup, bcf21.VisualizationInfo>( | ||
await BcfConverter.Converter.BcfConverter.ParseMarkups<bcf21.Markup, bcf21.VisualizationInfo>( | ||
"Resources/Bcf/v2.1/AllPartsVisible.bcfzip"); | ||
var markup = markups.FirstOrDefault()!; | ||
Assert.AreEqual(1, markups.Count); | ||
|
@@ -41,7 +42,7 @@ public async Task ParseBcfAllPartsVisibleTest() { | |
[Category("BCF v2.1")] | ||
public async Task ParseBcfComponentsSelection21Test() { | ||
var markups = | ||
await BcfConverter.ParseMarkups<bcf21.Markup, bcf21.VisualizationInfo>( | ||
await BcfConverter.Converter.BcfConverter.ParseMarkups<bcf21.Markup, bcf21.VisualizationInfo>( | ||
"Resources/Bcf/v2.1/ComponentSelection.bcfzip"); | ||
var markup = markups.FirstOrDefault(); | ||
Assert.AreEqual(1, markups.Count); | ||
|
@@ -64,7 +65,7 @@ public async Task ParseBcfComponentsSelection21Test() { | |
[Category("BCF v2.1")] | ||
public async Task ParseBcfExternalBimSnippetTest() { | ||
var markups = | ||
await BcfConverter.ParseMarkups<bcf21.Markup, bcf21.VisualizationInfo>( | ||
await BcfConverter.Converter.BcfConverter.ParseMarkups<bcf21.Markup, bcf21.VisualizationInfo>( | ||
"Resources/Bcf/v2.1/ExternalBIMSnippet.bcfzip"); | ||
var markup = markups.FirstOrDefault()!; | ||
Assert.AreEqual(1, markups.Count); | ||
|
@@ -79,7 +80,7 @@ public async Task ParseBcfExternalBimSnippetTest() { | |
[Category("BCF v2.1")] | ||
public async Task ParseBcfMultipleMarkupsTest() { | ||
var markups = | ||
await BcfConverter.ParseMarkups<bcf21.Markup, bcf21.VisualizationInfo>( | ||
await BcfConverter.Converter.BcfConverter.ParseMarkups<bcf21.Markup, bcf21.VisualizationInfo>( | ||
"Resources/Bcf/v2.1/MaximumInformation.bcfzip"); | ||
Assert.AreEqual(2, markups.Count); | ||
} | ||
|
@@ -91,7 +92,7 @@ public async Task ParseBcfMultipleMarkupsTest() { | |
[Category("BCF v2.1")] | ||
public void ParseBcfNoMarkupsTest() { | ||
Assert.That(async () => | ||
await BcfConverter.ParseMarkups<bcf21.Markup, bcf21.VisualizationInfo>( | ||
await BcfConverter.Converter.BcfConverter.ParseMarkups<bcf21.Markup, bcf21.VisualizationInfo>( | ||
"Resources/Bcf/v2.1/NoMakrups.bcfzip"), Throws.Exception); | ||
} | ||
|
||
|
@@ -103,7 +104,7 @@ public void ParseBcfNoMarkupsTest() { | |
[Category("BCF v2.1")] | ||
public void ParseBcfRelatedTopics21Test() { | ||
Assert.That( | ||
async () => await BcfConverter.ParseMarkups<bcf21.Markup, bcf21.VisualizationInfo>( | ||
async () => await BcfConverter.Converter.BcfConverter.ParseMarkups<bcf21.Markup, bcf21.VisualizationInfo>( | ||
"Resources/Bcf/v2.1/RelatedTopics.bcfzip"), Throws.Exception); | ||
// var markup1 = markups.FirstOrDefault()!; | ||
// var markup2 = markups.ElementAt(1); | ||
|
@@ -120,7 +121,7 @@ public void ParseBcfRelatedTopics21Test() { | |
[Category("BCF v2.1")] | ||
public void ParseBcfSingleVisibleWallTest() { | ||
Assert.That(async () => | ||
await BcfConverter.ParseMarkups<bcf21.Markup, bcf21.VisualizationInfo>( | ||
await BcfConverter.Converter.BcfConverter.ParseMarkups<bcf21.Markup, bcf21.VisualizationInfo>( | ||
"Resources/Bcf/v2.1/SingleVisibleWall.bcfzip"), Throws.Exception); | ||
// var markup = markups.FirstOrDefault()!; | ||
// var visInfo = | ||
|
@@ -138,7 +139,7 @@ public void ParseBcfSingleVisibleWallTest() { | |
[Category("BCF v2.1")] | ||
public async Task ParseBcfUserAssignment21Test() { | ||
var markups = | ||
await BcfConverter.ParseMarkups<bcf21.Markup, bcf21.VisualizationInfo>( | ||
await BcfConverter.Converter.BcfConverter.ParseMarkups<bcf21.Markup, bcf21.VisualizationInfo>( | ||
"Resources/Bcf/v2.1/UserAssignment.bcfzip"); | ||
var markup = markups.FirstOrDefault()!; | ||
Assert.AreEqual("[email protected]", markup.Topic.AssignedTo); | ||
|
@@ -151,8 +152,7 @@ public async Task ParseBcfUserAssignment21Test() { | |
[Category("BCF v3.0")] | ||
public async Task ParseBcfComponentsSelection30Test() { | ||
var markups = | ||
await BcfConverter | ||
.ParseMarkups<bcf30.Markup, bcf30.VisualizationInfo>( | ||
await BcfConverter.Converter.BcfConverter.ParseMarkups<bcf30.Markup, bcf30.VisualizationInfo>( | ||
"Resources/Bcf/v3.0/ComponentSelection.bcfzip"); | ||
var markup = markups.FirstOrDefault(); | ||
Assert.AreEqual(1, markups.Count); | ||
|
@@ -176,8 +176,7 @@ await BcfConverter | |
[Category("BCF v3.0")] | ||
public async Task ParseBcfDocumentRefExternalTest() { | ||
var markups = | ||
await BcfConverter | ||
.ParseMarkups<bcf30.Markup, bcf30.VisualizationInfo>( | ||
await BcfConverter.Converter.BcfConverter.ParseMarkups<bcf30.Markup, bcf30.VisualizationInfo>( | ||
"Resources/Bcf/v3.0/DocumentReferenceExternal.bcfzip"); | ||
var markup = markups.FirstOrDefault()!; | ||
Assert.AreEqual(1, markups.Count); | ||
|
@@ -196,11 +195,10 @@ await BcfConverter | |
[Category("BCF v3.0")] | ||
public async Task ParseBcfDocumentRefInternalTest() { | ||
var markups = | ||
await BcfConverter | ||
.ParseMarkups<bcf30.Markup, bcf30.VisualizationInfo>( | ||
await BcfConverter.Converter.BcfConverter.ParseMarkups<bcf30.Markup, bcf30.VisualizationInfo>( | ||
"Resources/Bcf/v3.0/DocumentReferenceInternal.bcfzip"); | ||
var documentInfo = | ||
await BcfConverter.ParseDocuments<bcf30.DocumentInfo>( | ||
await BcfConverter.Converter.BcfConverter.ParseDocuments<bcf30.DocumentInfo>( | ||
"Resources/Bcf/v3.0/DocumentReferenceInternal.bcfzip"); | ||
var markup = markups.FirstOrDefault()!; | ||
Assert.AreEqual(1, markups.Count); | ||
|
@@ -218,7 +216,7 @@ await BcfConverter | |
[Category("BCF v3.0")] | ||
public async Task ParseBcfDueDateTest() { | ||
var markups = | ||
await BcfConverter | ||
await BcfConverter.Converter.BcfConverter | ||
.ParseMarkups<bcf30.Markup, bcf30.VisualizationInfo>( | ||
"Resources/Bcf/v3.0/DueDate.bcfzip"); | ||
var markup = markups.FirstOrDefault()!; | ||
|
@@ -235,12 +233,12 @@ await BcfConverter | |
[Category("BCF v3.0")] | ||
public async Task ParseBcfLabelsTest() { | ||
var markups = | ||
await BcfConverter | ||
await BcfConverter.Converter.BcfConverter | ||
.ParseMarkups<bcf30.Markup, bcf30.VisualizationInfo>( | ||
"Resources/Bcf/v3.0/Labels.bcfzip"); | ||
var markup = markups.FirstOrDefault()!; | ||
var extensions = | ||
await BcfConverter.ParseExtensions<bcf30.Extensions>( | ||
await BcfConverter.Converter.BcfConverter.ParseExtensions<bcf30.Extensions>( | ||
"Resources/Bcf/v3.0/Labels.bcfzip"); | ||
Assert.AreEqual(1, markups.Count); | ||
var label = markup.Topic.Labels.FirstOrDefault(); | ||
|
@@ -256,12 +254,12 @@ await BcfConverter | |
[Category("BCF v3.0")] | ||
public async Task ParseBcfStageTest() { | ||
var markups = | ||
await BcfConverter | ||
await BcfConverter.Converter.BcfConverter | ||
.ParseMarkups<bcf30.Markup, bcf30.VisualizationInfo>( | ||
"Resources/Bcf/v3.0/Milestone.bcfzip"); | ||
var markup = markups.FirstOrDefault()!; | ||
var extensions = | ||
await BcfConverter.ParseExtensions<bcf30.Extensions>( | ||
await BcfConverter.Converter.BcfConverter.ParseExtensions<bcf30.Extensions>( | ||
"Resources/Bcf/v3.0/Milestone.bcfzip"); | ||
Assert.AreEqual(1, markups.Count); | ||
var stage = markup.Topic.Stage; | ||
|
@@ -277,7 +275,7 @@ await BcfConverter | |
[Category("BCF v3.0")] | ||
public async Task ParseBcfRelatedTopics30Test() { | ||
var markups = | ||
await BcfConverter | ||
await BcfConverter.Converter.BcfConverter | ||
.ParseMarkups<bcf30.Markup, bcf30.VisualizationInfo>( | ||
"Resources/Bcf/v3.0/RelatedTopics.bcfzip"); | ||
var markup1 = markups.FirstOrDefault()!; | ||
|
@@ -295,7 +293,7 @@ await BcfConverter | |
[Category("BCF v3.0")] | ||
public async Task ParseBcfSingleInvisibleWallTest() { | ||
var markups = | ||
await BcfConverter | ||
await BcfConverter.Converter.BcfConverter | ||
.ParseMarkups<bcf30.Markup, bcf30.VisualizationInfo>( | ||
"Resources/Bcf/v3.0/SingleInvisibleWall.bcfzip"); | ||
var markup = markups.FirstOrDefault()!; | ||
|
@@ -317,7 +315,7 @@ await BcfConverter | |
[Category("BCF v3.0")] | ||
public async Task ParseBcfDifferentModelsVisibleTest() { | ||
var markups = | ||
await BcfConverter | ||
await BcfConverter.Converter.BcfConverter | ||
.ParseMarkups<bcf30.Markup, bcf30.VisualizationInfo>( | ||
"Resources/Bcf/v3.0/TopicsWithDifferentModelsVisible.bcfzip"); | ||
var markupARC = markups.FirstOrDefault(m => | ||
|
@@ -341,7 +339,7 @@ await BcfConverter | |
[Category("BCF v3.0")] | ||
public async Task ParseBcfUserAssignment30Test() { | ||
var markups = | ||
await BcfConverter.ParseMarkups<bcf30.Markup, bcf30.VisualizationInfo>( | ||
await BcfConverter.Converter.BcfConverter.ParseMarkups<bcf30.Markup, bcf30.VisualizationInfo>( | ||
"Resources/Bcf/v3.0/UserAssignment.bcfzip"); | ||
var markup = markups.FirstOrDefault()!; | ||
Assert.AreEqual("[email protected]", markup.Topic.AssignedTo); | ||
|
@@ -353,12 +351,12 @@ public async Task ParseBcfUserAssignment30Test() { | |
[Test] | ||
public async Task ParseRequiredObjectTest() { | ||
var extensions = | ||
await BcfConverter.ParseExtensions<bcf30.Extensions>( | ||
await BcfConverter.Converter.BcfConverter.ParseExtensions<bcf30.Extensions>( | ||
"Resources/Bcf/v3.0/Milestone.bcfzip"); | ||
var type = extensions.TopicTypes.FirstOrDefault(); | ||
Assert.AreEqual("Error", type); | ||
|
||
Assert.That(async () => await BcfConverter.ParseExtensions<bcf30.Extensions>( | ||
Assert.That(async () => await BcfConverter.Converter.BcfConverter.ParseExtensions<bcf30.Extensions>( | ||
"Resources/Bcf/v3.0/WithoutRequiredExtension.bcfzip"), Throws.Exception); | ||
} | ||
|
||
|
@@ -378,7 +376,7 @@ public async Task WriteBcfWithMinimumInformationTest() { | |
}; | ||
var markups = new ConcurrentBag<bcf21.Markup> { markup }; | ||
var root = new bcf21.Root(); | ||
await BcfConverter.WriteBcf<bcf21.Markup, bcf21.VisualizationInfo, bcf21.Root, bcf21.Version>( | ||
await BcfConverter.Converter.BcfConverter.WriteBcf<bcf21.Markup, bcf21.VisualizationInfo, bcf21.Root, bcf21.Version>( | ||
"Resources/output/Bcf/v2.1/MinimumInformation.bcfzip", | ||
markups, | ||
root); | ||
|
@@ -399,7 +397,7 @@ public async Task WriteBcfWithoutTopicGuidTest() { | |
}; | ||
var markups = new ConcurrentBag<bcf21.Markup> { markup }; | ||
var root = new bcf21.Root(); | ||
await BcfConverter.WriteBcf<bcf21.Markup, bcf21.VisualizationInfo, bcf21.Root, bcf21.Version>( | ||
await BcfConverter.Converter.BcfConverter.WriteBcf<bcf21.Markup, bcf21.VisualizationInfo, bcf21.Root, bcf21.Version>( | ||
"Resources/output/Bcf/v2.1/WithoutTopicGuid.bcfzip", | ||
markups, | ||
root); | ||
|
@@ -412,7 +410,7 @@ public async Task WriteBcfWithoutTopicGuidTest() { | |
[Category("BCF v2.1")] | ||
public void ParseBcfMissingTopicTitleTest() { | ||
Assert.That(async () => | ||
await BcfConverter.ParseMarkups<bcf21.Markup, bcf21.VisualizationInfo>( | ||
await BcfConverter.Converter.BcfConverter.ParseMarkups<bcf21.Markup, bcf21.VisualizationInfo>( | ||
"Resources/Bcf/v2.1/MissingTitle.bcfzip"), Throws.Exception); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters