This repository has been archived by the owner on Jan 14, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #183 from difi/StoppSendingMotFeilMlijo
Stopp sending mot feil mlijø
- Loading branch information
Showing
24 changed files
with
374 additions
and
208 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
24 changes: 24 additions & 0 deletions
24
Difi.SikkerDigitalPost.Klient.Domene/Extensions/EnumExtensions.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,24 @@ | ||
using System; | ||
using Difi.Felles.Utility; | ||
|
||
namespace Difi.SikkerDigitalPost.Klient.Domene.Extensions | ||
{ | ||
internal static class EnumExtensions | ||
{ | ||
public static string ToNorwegianString(this CertificateValidationType certificateValidationType) | ||
{ | ||
switch (certificateValidationType) | ||
{ | ||
case CertificateValidationType.Valid: | ||
return "Gyldig"; | ||
case CertificateValidationType.InvalidCertificate: | ||
return "UgyldigSertifikat"; | ||
case CertificateValidationType.InvalidChain: | ||
return "UgyldigKjede"; | ||
default: | ||
throw new ArgumentOutOfRangeException(nameof(certificateValidationType), certificateValidationType, null); | ||
} | ||
} | ||
|
||
} | ||
} |
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,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="api-client-shared" version="1.0.5941.27271" targetFramework="net45" /> | ||
<package id="api-client-shared" version="1.0.5968.19413" targetFramework="net45" /> | ||
<package id="difi-felles-utility-dotnet" version="0.8.0.27738" targetFramework="net45" /> | ||
</packages> |
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,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="api-client-shared" version="1.0.5941.27271" targetFramework="net45" /> | ||
<package id="api-client-shared" version="1.0.5968.19413" targetFramework="net45" /> | ||
</packages> |
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
26 changes: 26 additions & 0 deletions
26
Difi.SikkerDigitalPost.Klient.Tester/Extensions/EnumExtensionsTests.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,26 @@ | ||
using System; | ||
using System.Linq; | ||
using Difi.Felles.Utility; | ||
using Xunit; | ||
using Difi.SikkerDigitalPost.Klient.Domene.Extensions; | ||
|
||
namespace Difi.SikkerDigitalPost.Klient.Tester.Extensions | ||
{ | ||
public class EnumExtensionsTests | ||
{ | ||
public class ToNorwegianStringMethod | ||
{ | ||
[Fact] | ||
public void Converts_all_enum_values() | ||
{ | ||
var certificateValidationTypes = Enum.GetValues(typeof(CertificateValidationType)).Cast<CertificateValidationType>(); | ||
|
||
foreach (var certificateValidationType in certificateValidationTypes) | ||
{ | ||
certificateValidationType.ToNorwegianString(); | ||
} | ||
} | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.