-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Replace] hand-coded readers with generated readers
[Add] BMN xmi file for extra testing
- Loading branch information
1 parent
dd9ba12
commit 91d3933
Showing
50 changed files
with
4,802 additions
and
2,616 deletions.
There are no files selected for viewing
78 changes: 78 additions & 0 deletions
78
uml4net.xmi.Tests/DecisionModelNotationReaderTestFixture.cs
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 |
---|---|---|
@@ -0,0 +1,78 @@ | ||
// ------------------------------------------------------------------------------------------------- | ||
// <copyright file="DecisionModelNotationReaderTestFixture.cs" company="Starion Group S.A."> | ||
// | ||
// Copyright 2019-2024 Starion Group S.A. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
// </copyright> | ||
// ------------------------------------------------------------------------------------------------ | ||
|
||
namespace uml4net.xmi.Tests | ||
{ | ||
using System.IO; | ||
using System.Linq; | ||
|
||
using Microsoft.Extensions.Logging; | ||
|
||
using NUnit.Framework; | ||
|
||
using Serilog; | ||
|
||
using uml4net.Values; | ||
using uml4net.Packages; | ||
using uml4net.SimpleClassifiers; | ||
using uml4net.StructuredClassifiers; | ||
using uml4net.xmi; | ||
|
||
[TestFixture] | ||
public class DecisionModelNotationReaderTestFixture | ||
{ | ||
private ILoggerFactory loggerFactory; | ||
|
||
[OneTimeSetUp] | ||
public void OneTimeSetUp() | ||
{ | ||
Log.Logger = new LoggerConfiguration() | ||
.MinimumLevel.Debug() | ||
.WriteTo.Console() | ||
.CreateLogger(); | ||
|
||
this.loggerFactory = LoggerFactory.Create(builder => | ||
{ | ||
builder.AddSerilog(); | ||
}); | ||
} | ||
|
||
[Test] | ||
public void Verify_that_DMN_XMI_can_be_read() | ||
{ | ||
var rootPath = Path.Combine(TestContext.CurrentContext.TestDirectory, "TestData"); | ||
|
||
var reader = XmiReaderBuilder.Create() | ||
.UsingSettings(x => x.LocalReferenceBasePath = rootPath) | ||
.WithLogger(this.loggerFactory) | ||
.Build(); | ||
|
||
var xmiReaderResult = reader.Read(Path.Combine(TestContext.CurrentContext.TestDirectory, "TestData", "dtc-23-02-13.xmi.xml")); | ||
|
||
Assert.That(xmiReaderResult.Packages.Count, Is.EqualTo(2)); | ||
|
||
var model = xmiReaderResult.Root as IModel; | ||
|
||
Assert.That(model.Name, Is.EqualTo("Data")); | ||
|
||
Assert.That(model.NestedPackage.Count, Is.EqualTo(4)); | ||
} | ||
} | ||
} |
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ders/StructuredClassifiers/ClassReader.cs → uml4net.xmi/AutoGenXmiReaders/ClassReader.cs
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
File renamed without changes.
Oops, something went wrong.