-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
10 changed files
with
280 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
|
||
<IsPackable>false</IsPackable> | ||
<IsTestProject>true</IsTestProject> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0"/> | ||
<PackageReference Include="NUnit" Version="3.13.3"/> | ||
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2"/> | ||
<PackageReference Include="NUnit.Analyzers" Version="3.6.1"/> | ||
<PackageReference Include="coverlet.collector" Version="3.2.0"/> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Folder Include="Data\" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\EXDCommon\EXDCommon.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Content Include="Data\Schemas\*.yml"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
</ItemGroup> | ||
|
||
</Project> |
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 @@ | ||
global using NUnit.Framework; |
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,66 @@ | ||
using EXDCommon.SchemaModel.EXDSchema; | ||
using EXDCommon.Utility; | ||
|
||
namespace EXDCommon.Tests; | ||
|
||
public class Tests | ||
{ | ||
[Test] | ||
public void TestDeserializeSheet() | ||
{ | ||
var content = File.ReadAllText("Data/Schemas/Aetheryte.yml"); | ||
var sheet = SerializeUtil.Deserialize<Sheet>(content); | ||
Assert.That(sheet, Is.Not.Null); | ||
} | ||
|
||
// [Test] | ||
// public void TestReserializeObjectBased() | ||
// { | ||
// var content = File.ReadAllText("Data/Schemas/Aetheryte.yml"); | ||
// var sheet = SerializeUtil.Deserialize<Sheet>(content); | ||
// var content2 = SerializeUtil.Serialize(sheet); | ||
// var sheet2 = SerializeUtil.Deserialize<Sheet>(content2); | ||
// Assert.That(sheet, Is.EqualTo(sheet2)); | ||
// } | ||
|
||
[Test] | ||
public void TestReserializeTextBased() | ||
{ | ||
var content = File.ReadAllText("Data/Schemas/Aetheryte.yml"); | ||
var sheet = SerializeUtil.Deserialize<Sheet>(content); | ||
var content2 = SerializeUtil.Serialize(sheet); | ||
Assert.That(content2, Is.EqualTo(content)); | ||
} | ||
|
||
[Test] | ||
public void TestFlatten() | ||
{ | ||
var content = File.ReadAllText("Data/Schemas/Aetheryte.yml"); | ||
var sheet = SerializeUtil.Deserialize<Sheet>(content); | ||
var flattenedSheet = SchemaUtil.Flatten(sheet); | ||
var count = SchemaUtil.GetColumnCount(sheet); | ||
Assert.That(flattenedSheet.Fields, Has.Count.EqualTo(count)); | ||
} | ||
|
||
// [Test] | ||
// public void TestUnflattenObjectBased() | ||
// { | ||
// var content = File.ReadAllText("Data/Schemas/AnimationLOD.yml"); | ||
// var sheet = SerializeUtil.Deserialize<Sheet>(content); | ||
// var flattenedSheet = SchemaUtil.Flatten(sheet); | ||
// var unflattenedSheet = SchemaUtil.Unflatten(flattenedSheet); | ||
// Assert.That(sheet, Is.EqualTo(unflattenedSheet)); | ||
// } | ||
|
||
// [TestCase("AnimationLOD")] | ||
[TestCase("Aetheryte")] | ||
public void TestUnflattenTextBased(string sheetName) | ||
{ | ||
var content = File.ReadAllText($"Data/Schemas/{sheetName}.yml"); | ||
var sheet = SerializeUtil.Deserialize<Sheet>(content); | ||
var flattenedSheet = SchemaUtil.Flatten(sheet); | ||
var unflattenedSheet = SchemaUtil.Unflatten(flattenedSheet); | ||
var content2 = SerializeUtil.Serialize(unflattenedSheet); | ||
Assert.That(content2, Is.EqualTo(content)); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,4 +1,11 @@ | ||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> | ||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=31C1028A_002DCB73_002D428B_002DB2E6_002D3DE791564840_002Ff_003ASchemaUpdater_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> | ||
<s:String x:Key="/Default/Environment/AssemblyExplorer/XmlDocument/@EntryValue"><AssemblyExplorer>
 | ||
<Assembly Path="C:\Users\Liam\.nuget\packages\lumina\3.15.2\lib\net7.0\Lumina.dll" />
 | ||
</AssemblyExplorer></s:String></wpf:ResourceDictionary> | ||
</AssemblyExplorer></s:String> | ||
<s:String x:Key="/Default/Environment/Highlighting/HighlightingSourceSnapshotLocation/@EntryValue">C:\Users\Liam\AppData\Local\JetBrains\Rider2023.3\resharper-host\temp\Rider\vAny\CoverageData\_EXDTools.641274775\Snapshot\snapshot.utdcvr</s:String> | ||
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=5928ebb5_002D1807_002D4275_002Daf73_002D50cf7f1d26e9/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" IsActive="True" Name="All tests from &lt;EXDCommon.Tests&gt; #3" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
 | ||
<Project Location="C:\Users\Liam\Documents\repos\EXDTools\EXDCommon.Tests" Presentation="&lt;EXDCommon.Tests&gt;" />
 | ||
</SessionState></s:String> | ||
|
||
</wpf:ResourceDictionary> |
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
Oops, something went wrong.