-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor to remove null-forgiving operator related to `AltinnPaymentC…
…onfiguration.PaymentDataType` (#657)
- Loading branch information
1 parent
d70d21a
commit e3a4d68
Showing
10 changed files
with
124 additions
and
84 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
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
32 changes: 32 additions & 0 deletions
32
test/Altinn.App.Core.Tests/Features/Payment/AltinnPaymentConfigurationTests.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,32 @@ | ||
using Altinn.App.Core.Internal.App; | ||
using Altinn.App.Core.Internal.Process.Elements.AltinnExtensionProperties; | ||
using FluentAssertions; | ||
|
||
namespace Altinn.App.Core.Tests.Features.Payment; | ||
|
||
public class AltinnPaymentConfigurationTests | ||
{ | ||
[Theory] | ||
[InlineData(null)] | ||
[InlineData("")] | ||
[InlineData(" ")] | ||
public void Validation_ThrowsException_When_PaymentDataType_Is_Invalid(string? paymentDataType) | ||
{ | ||
AltinnPaymentConfiguration paymentConfiguration = new() { PaymentDataType = paymentDataType }; | ||
|
||
var action = () => paymentConfiguration.Validate(); | ||
|
||
action.Should().Throw<ApplicationConfigException>(); | ||
} | ||
|
||
[Fact] | ||
public void Validation_Succeeds() | ||
{ | ||
var paymentDataType = "paymentDataType"; | ||
AltinnPaymentConfiguration paymentConfiguration = new() { PaymentDataType = paymentDataType }; | ||
paymentConfiguration.PaymentDataType.Should().Be(paymentDataType); | ||
|
||
var validPaymentConfiguration = paymentConfiguration.Validate(); | ||
validPaymentConfiguration.PaymentDataType.Should().Be(paymentDataType); | ||
} | ||
} |
Oops, something went wrong.