diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 73f17d5..c5377b4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/setup-dotnet@v4 with: - dotnet-version: '8.0.x' + dotnet-version: '9.0.x' - name: Install dotnet format run: dotnet tool update --global dotnet-format diff --git a/bcf-toolkit.sln.DotSettings.user b/bcf-toolkit.sln.DotSettings.user index 28cad9c..21dec4c 100644 --- a/bcf-toolkit.sln.DotSettings.user +++ b/bcf-toolkit.sln.DotSettings.user @@ -1,8 +1,14 @@  + ForceIncluded /Users/balintbende/Library/Caches/JetBrains/Rider2024.1/resharper-host/temp/Rider/vAny/CoverageData/_bcf-toolkit.-1315391344/Snapshot/snapshot.utdcvr <SessionState ContinuousTestingMode="0" Name="All tests from Solution #2" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"> <Solution /> </SessionState> + <SessionState ContinuousTestingMode="0" IsActive="True" Name="All tests from Solution" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"> + <Solution /> +</SessionState> + + <SessionState ContinuousTestingMode="0" IsActive="True" Name="All tests from Solution #3" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"> <Solution /> </SessionState> @@ -79,6 +85,8 @@ + + diff --git a/src/bcf-toolkit/Model/Bcf21/VisInfo.cs b/src/bcf-toolkit/Model/Bcf21/VisInfo.cs index ad07be7..b623ea1 100644 --- a/src/bcf-toolkit/Model/Bcf21/VisInfo.cs +++ b/src/bcf-toolkit/Model/Bcf21/VisInfo.cs @@ -722,9 +722,9 @@ public bool BitmapSpecified /// /// Pattern: [a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}. + /// This field is required but was not mentioned in the documentation. /// [System.ComponentModel.DataAnnotations.RegularExpressionAttribute("[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}")] - [System.ComponentModel.DataAnnotations.RequiredAttribute(AllowEmptyStrings=true)] [System.Xml.Serialization.XmlAttributeAttribute("Guid")] public string Guid { get; set; } } diff --git a/src/bcf-toolkit/Model/Bcf30/Visinfo.cs b/src/bcf-toolkit/Model/Bcf30/Visinfo.cs index 227fd18..d51c8db 100644 --- a/src/bcf-toolkit/Model/Bcf30/Visinfo.cs +++ b/src/bcf-toolkit/Model/Bcf30/Visinfo.cs @@ -789,9 +789,9 @@ public bool BitmapsSpecified /// /// Pattern: [a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}. + /// This field is required but was not mentioned in the documentation. /// [System.ComponentModel.DataAnnotations.RegularExpressionAttribute("[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}")] - [System.ComponentModel.DataAnnotations.RequiredAttribute(AllowEmptyStrings=true)] [System.Xml.Serialization.XmlAttributeAttribute("Guid")] public string Guid { get; set; } } diff --git a/src/bcf-toolkit/bcf-toolkit.csproj b/src/bcf-toolkit/bcf-toolkit.csproj index ea617b0..3d4e83e 100644 --- a/src/bcf-toolkit/bcf-toolkit.csproj +++ b/src/bcf-toolkit/bcf-toolkit.csproj @@ -2,7 +2,7 @@ Smino.Bcf.Toolkit Exe - net8.0 + net9.0 latest enable bcf-toolkit diff --git a/src/tests/Builder/Bcf21/BcfBuilderTests.cs b/src/tests/Builder/Bcf21/BcfBuilderTests.cs index 8179a80..3a40013 100644 --- a/src/tests/Builder/Bcf21/BcfBuilderTests.cs +++ b/src/tests/Builder/Bcf21/BcfBuilderTests.cs @@ -9,7 +9,7 @@ using BcfToolkit.Model.Bcf21; using NUnit.Framework; -namespace tests.Builder.Bcf21; +namespace Tests.Builder.Bcf21; public class BcfBuilderTests { private BcfBuilder _builder = null!; diff --git a/src/tests/Builder/Bcf21/SuperBcfFile.cs b/src/tests/Builder/Bcf21/SuperBcfFile.cs index 96989c7..42457de 100644 --- a/src/tests/Builder/Bcf21/SuperBcfFile.cs +++ b/src/tests/Builder/Bcf21/SuperBcfFile.cs @@ -10,7 +10,7 @@ using BcfToolkit.Model.Bcf21; using NUnit.Framework; -namespace tests.Builder.Bcf21; +namespace Tests.Builder.Bcf21; public class SuperBcfFile { @@ -162,7 +162,7 @@ public async Task CreateSuperBcf21File() { var visualizationInfo = visualizationInfoBuilder - .SetGuid("333b4df2-0187-49a9-8a4a-23992696bafd") + // .SetGuid("333b4df2-0187-49a9-8a4a-23992696bafd") .SetOrthogonalCamera(ortho) .SetViewSetupHints(vsHint) .AddBitmaps(visBitmaps) @@ -235,7 +235,6 @@ public async Task CreateSuperBcf21File() { .SetProjectId("3ZSh2muKX7S8MCESk95seC") .SetProjectName("projectName") .SetExtensionSchema("extensionSchema")) - // .SetDocumentData(docData) .Build(); await _converter.ToBcf(bcf, diff --git a/src/tests/Builder/Bcf30/BcfBuilderTests.cs b/src/tests/Builder/Bcf30/BcfBuilderTests.cs index 4693054..a707002 100644 --- a/src/tests/Builder/Bcf30/BcfBuilderTests.cs +++ b/src/tests/Builder/Bcf30/BcfBuilderTests.cs @@ -4,7 +4,7 @@ using BcfToolkit.Builder.Bcf30; using NUnit.Framework; -namespace tests.Builder.Bcf30; +namespace Tests.Builder.Bcf30; public class BcfBuilderTests { private BcfBuilder _builder = null!; diff --git a/src/tests/Builder/Bcf30/SuperBcfFile.cs b/src/tests/Builder/Bcf30/SuperBcfFile.cs index 2d8e940..f6ed4e0 100644 --- a/src/tests/Builder/Bcf30/SuperBcfFile.cs +++ b/src/tests/Builder/Bcf30/SuperBcfFile.cs @@ -12,7 +12,7 @@ using BcfBuilder = BcfToolkit.Builder.Bcf30.BcfBuilder; using File = BcfToolkit.Model.Bcf30.File; -namespace tests.Builder.Bcf30; +namespace Tests.Builder.Bcf30; public class SuperBcfFile { @@ -168,7 +168,6 @@ public async Task CreateSuperBcf30File() { var visualizationInfo = visualizationInfoBuilder - .SetGuid("334b4df2-0187-49a9-8a4a-23992696bafd") .SetPerspectiveCamera(pers) .AddBitmaps(bitmaps) .AddColorings(colorings) diff --git a/src/tests/Resources/Bcf/v2.1/MissingVisualizationInfoGuid.bcfzip b/src/tests/Resources/Bcf/v2.1/MissingVisualizationInfoGuid.bcfzip new file mode 100644 index 0000000..c2814d5 Binary files /dev/null and b/src/tests/Resources/Bcf/v2.1/MissingVisualizationInfoGuid.bcfzip differ diff --git a/src/tests/Utils/BcfExtensionsTests.cs b/src/tests/Utils/BcfExtensionsTests.cs index 7483edd..fafb933 100644 --- a/src/tests/Utils/BcfExtensionsTests.cs +++ b/src/tests/Utils/BcfExtensionsTests.cs @@ -7,7 +7,7 @@ using bcf21 = BcfToolkit.Model.Bcf21; using bcf30 = BcfToolkit.Model.Bcf30; -namespace tests.Utils; +namespace Tests.Utils; [TestFixture] public class BcfExtensionsTests { diff --git a/src/tests/Utils/JsonExtensionsTests.cs b/src/tests/Utils/JsonExtensionsTests.cs index 0b1c281..5c0da3b 100644 --- a/src/tests/Utils/JsonExtensionsTests.cs +++ b/src/tests/Utils/JsonExtensionsTests.cs @@ -5,7 +5,7 @@ using bcf21 = BcfToolkit.Model.Bcf21; using bcf30 = BcfToolkit.Model.Bcf30; -namespace tests.Utils; +namespace Tests.Utils; public class JsonExtensionsTests { /// diff --git a/src/tests/Utils/ZipArchiveEntryExtensionsTests.cs b/src/tests/Utils/ZipArchiveEntryExtensionsTests.cs index d47a9d6..0e413b5 100644 --- a/src/tests/Utils/ZipArchiveEntryExtensionsTests.cs +++ b/src/tests/Utils/ZipArchiveEntryExtensionsTests.cs @@ -5,7 +5,7 @@ using BcfToolkit.Utils; using NUnit.Framework; -namespace tests.Utils; +namespace Tests.Utils; [TestFixture] public class ZipArchiveEntryExtensionsTests { diff --git a/src/tests/WorkerTests.cs b/src/tests/WorkerTests.cs index 9f18876..95f0702 100644 --- a/src/tests/WorkerTests.cs +++ b/src/tests/WorkerTests.cs @@ -40,15 +40,12 @@ public async Task BuildBcfFromV21StreamTest() { [Category("BCF v2.1")] public async Task BuildBcfFromV21StreamSamplesTests() { var samples = new List { - // "Resources/Bcf/v2.1/AllPartsVisible.bcfzip", // assigned to is empty "Resources/Bcf/v2.1/ComponentSelection.bcfzip", "Resources/Bcf/v2.1/ExternalBIMSnippet.bcfzip", "Resources/Bcf/v2.1/MaximumInformation.bcfzip", "Resources/Bcf/v2.1/MinimumInformation.bcfzip", "Resources/Bcf/v2.1/MiniSolibri.bcfzip", - // "Resources/Bcf/v2.1/RelatedTopics.bcfzip", // comment property is empty - // "Resources/Bcf/v2.1/SingleVisibleWall.bcfzip", // comment property is empty - // "Resources/Bcf/v2.1/UserAssignment.bcfzip" // description is empty + "Resources/Bcf/v2.1/MissingVisualizationInfoGuid.bcfzip" }; var tasks = samples.Select(async path => { @@ -143,38 +140,6 @@ private async Task CheckBcfStreamVersion( await stream.FlushAsync(); } - // [Test] - // [Category("BCF v3.0")] - // public async Task BcfV30ToV21StreamSamplesTests() { - // var samples = new List { - // "Resources/Bcf/v3.0/ComponentSelection.bcfzip", - // "Resources/Bcf/v3.0/DocumentReferenceExternal.bcfzip", - // "Resources/Bcf/v3.0/DocumentReferenceInternal.bcfzip", - // "Resources/Bcf/v3.0/DueDate.bcfzip", - // "Resources/Bcf/v3.0/Labels.bcfzip", - // "Resources/Bcf/v3.0/Milestone.bcfzip", - // "Resources/Bcf/v3.0/RelatedTopics.bcfzip", - // "Resources/Bcf/v3.0/SingleInvisibleWall.bcfzip", - // "Resources/Bcf/v3.0/TestBcf30.bcfzip", - // "Resources/Bcf/v3.0/TopicsWithDifferentModelsVisible.bcfzip", - // "Resources/Bcf/v3.0/UserAssignment.bcfzip" - // }; - // - // var tasks = samples.Select(async path => { - // var builder = new BcfToolkit.Builder.Bcf30.BcfBuilder(); - // await using var inputStream = - // new FileStream(path, FileMode.Open, FileAccess.Read); - // - // var bcf = await builder.BuildFromStream(inputStream); - // var stream = await _worker.ToBcf(bcf, BcfVersionEnum.Bcf21); - // var version = await BcfExtensions.GetVersionFromStreamArchive(stream); - // Assert.That(BcfVersionEnum.Bcf21, Is.EqualTo(version)); - // await stream.FlushAsync(); - // }).ToArray(); - // - // await Task.WhenAll(tasks); - // } - [Test] [Category("BCF v2.1")] public async Task ConvertBcfZipToJsonV21SamplesTests() { @@ -207,7 +172,7 @@ public async Task ConvertBcfZipToJsonV30SamplesTests() { "Resources/Bcf/v3.0/SingleInvisibleWall.bcfzip", "Resources/Bcf/v3.0/TestBcf30.bcfzip", "Resources/Bcf/v3.0/TopicsWithDifferentModelsVisible.bcfzip", - "Resources/Bcf/v3.0/UserAssignment.bcfzip" + "Resources/Bcf/v3.0/UserAssignment.bcfzip", }; var tasks = samples.Select(async source => { var target = @@ -346,12 +311,5 @@ public async Task ToBcfWithFileStream() { await outputStream.FlushAsync(); outputStream.Close(); - - // await using var inputStream = new FileStream( - // path, - // FileMode.Open, - // FileAccess.Read); - // var bcfResult = await _worker.BcfFromStream(inputStream); - // Assert.That(bcfResult.Markups.Count, Is.EqualTo(1)); } } \ No newline at end of file diff --git a/src/tests/tests.csproj b/src/tests/tests.csproj index 2983214..0fcd0e1 100644 --- a/src/tests/tests.csproj +++ b/src/tests/tests.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 false