Skip to content

Commit

Permalink
test: write a test for it
Browse files Browse the repository at this point in the history
  • Loading branch information
tnotheis committed Dec 16, 2024
1 parent 3355f71 commit 86dbfdb
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,21 @@ public void Throws_when_deletion_process_is_in_wrong_status()
acting.Should().Throw<DomainException>().Which.Code.Should().Be("error.platform.validation.device.deletionProcessIsNotInRequiredStatus");
}

[Fact]
public void Throws_when_grace_period_has_expired()
{
// Arrange
var identity = TestDataGenerator.CreateIdentityWithApprovedDeletionProcess();

SystemTime.Set(DateTime.UtcNow.AddDays(IdentityDeletionConfiguration.Instance.LengthOfGracePeriodInDays));

// Act
var acting = () => identity.CancelDeletionProcessAsOwner(identity.DeletionProcesses[0].Id, identity.Devices[0].Id);

// Assert
acting.Should().Throw<DomainException>().Which.Code.Should().Be("error.platform.validation.device.gracePeriodHasAlreadyExpired");
}

[Fact]
public void Raises_domain_events()
{
Expand Down

0 comments on commit 86dbfdb

Please sign in to comment.