Skip to content

Commit

Permalink
Fix bug related to incorrect version for N5_35
Browse files Browse the repository at this point in the history
ARKADE-524
  • Loading branch information
lhSunde committed Jun 2, 2021
1 parent 4b9b3e2 commit a53f50e
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<value>Noark 5</value>
<properties>
<property name="version">
<value>5.5</value>
<value>5.0</value>
</property>
</properties>
</property>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static Archive CreateArchiveExtractionV5_5(string testdataDirectory)
return new Base.ArchiveBuilder()
.WithArchiveType(ArchiveType.Noark5)
.WithWorkingDirectoryExternalContent(workingDirectory)
.WithArchiveDetails("5.5")
.WithArchiveDetails("5.0")
.Build();
}

Expand Down
5 changes: 1 addition & 4 deletions src/Arkivverket.Arkade.Core/Base/ArkadeTestNameProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ public static string GetDisplayName(TestId testId, SupportedLanguage language)

private static string GetDisplayName(TestId testId, CultureInfo culture)
{
string resourceDisplayNameKey = testId.ToString().Replace('.', '_');

if (testId.Version.Equals("5.5"))
resourceDisplayNameKey = $"{resourceDisplayNameKey}v5_5";
string resourceDisplayNameKey = $"{testId}{testId.Version}".Replace('.', '_');

string testName = ArkadeTestDisplayNames.ResourceManager.GetString(resourceDisplayNameKey, culture);

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@
<data name="N5_35" xml:space="preserve">
<value>Antall saksparter</value>
</data>
<data name="N5_35v5_5" xml:space="preserve">
<data name="N5_35v5_0" xml:space="preserve">
<value>Antall parter</value>
</data>
<data name="N5_36" xml:space="preserve">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@
<data name="N5_35" xml:space="preserve">
<value>Number of case parties</value>
</data>
<data name="N5_35v5_5" xml:space="preserve">
<data name="N5_35v5_0" xml:space="preserve">
<value>Number of parties</value>
</data>
<data name="N5_36" xml:space="preserve">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,7 @@ public class N5_35_NumberOfCaseParts : Noark5XmlReaderBaseTest

private string GetTestVersion()
{
string standardVersion = archive.Details.ArchiveStandard;

if (standardVersion.Equals("5.5"))
{
return "5.5";
}

return standardVersion;
return archive.Details.ArchiveStandard;
}

public N5_35_NumberOfCaseParts(Archive archive)
Expand Down Expand Up @@ -91,7 +84,7 @@ protected override void ReadElementValueEvent(object sender, ReadElementEventArg

protected override void ReadEndElementEvent(object sender, ReadElementEventArgs eventArgs)
{
if (archive.Details.ArchiveStandard.Equals("5.5"))
if (archive.Details.ArchiveStandard.Equals("5.0"))
{
CountPartsForVersion5_5(eventArgs);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Arkivverket.Arkade.Core/Util/TestId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ public class TestId : IComparable
{ TestKind.Unidentified, "U" },
};

public TestId(TestKind testKind, uint number, string version = "5.0")
public TestId(TestKind testKind, uint number, string version = default)
{
Kind = testKind;
Number = number;
Version = version;
Version = $"v{version}";
}

public static TestId Create(string testId)
Expand Down

0 comments on commit a53f50e

Please sign in to comment.