-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add system user properties to PlatformUser (#581)
- Loading branch information
1 parent
8ce2e56
commit fc0628c
Showing
5 changed files
with
64 additions
and
5 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
32 changes: 32 additions & 0 deletions
32
test/Altinn.Platform.Storage.Interface.Tests/SystemUser/PlatformUserTests.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 System; | ||
|
||
using Altinn.Platform.Storage.Interface.Models; | ||
|
||
using FluentAssertions; | ||
|
||
using Xunit; | ||
|
||
namespace Altinn.Platform.Storage.Interface.Tests.SystemUser; | ||
|
||
public class PlatformUserTests | ||
{ | ||
[Fact] | ||
public void MetadataWithoutShadowFields_ShouldBeFalse() | ||
{ | ||
PlatformUser target = TestdataHelper.LoadDataFromEmbeddedResourceAsType<PlatformUser>("SystemUser.platformUser_beforeChange.json"); | ||
|
||
target.SystemUserId.Should().BeNull(); | ||
target.SystemUserName.Should().BeNull(); | ||
target.SystemUserOwnerOrgNo.Should().BeNull(); | ||
} | ||
|
||
[Fact] | ||
public void MetadataWithShadowFields_ShouldBeTrue() | ||
{ | ||
PlatformUser target = TestdataHelper.LoadDataFromEmbeddedResourceAsType<PlatformUser>("SystemUser.platformUser_afterChange.json"); | ||
|
||
target.SystemUserId.Should().Be(Guid.Parse("2280457B-0A79-49C5-AC14-09217705C9A1")); | ||
target.SystemUserName.Should().Be("Vismalise"); | ||
target.SystemUserOwnerOrgNo.Should().Be("565433454"); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
test/Altinn.Platform.Storage.Interface.Tests/SystemUser/platformUser_afterChange.json
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,6 @@ | ||
{ | ||
"systemUserId": "2280457B-0A79-49C5-AC14-09217705C9A1", | ||
"systemUserOwnerOrgNo": "565433454", | ||
"systemUserName": "Vismalise", | ||
"authenticationLevel": 3 | ||
} |
4 changes: 4 additions & 0 deletions
4
test/Altinn.Platform.Storage.Interface.Tests/SystemUser/platformUser_beforeChange.json
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,4 @@ | ||
{ | ||
"orgId": "tdd", | ||
"authenticationLevel": 3 | ||
} |