From b9827bc48371d6abd279dff3a7b7d61edfd0fd21 Mon Sep 17 00:00:00 2001 From: Klaus Fischer <klaus.fischer@eloware.com> Date: Wed, 12 Oct 2022 12:17:24 +0200 Subject: [PATCH] Using const string instead of hard coded urls --- BasicUnitTest/SecurityEventTokenTests.cs | 29 ++++++------------------ 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/BasicUnitTest/SecurityEventTokenTests.cs b/BasicUnitTest/SecurityEventTokenTests.cs index 54bec971..2918b821 100644 --- a/BasicUnitTest/SecurityEventTokenTests.cs +++ b/BasicUnitTest/SecurityEventTokenTests.cs @@ -40,7 +40,7 @@ public class SecurityEventTokenTests { Console.WriteLine(token); var decoded = new SecurityEventToken(token); decoded.Event?.Type.Should() - .Be("https://schema.fitko.de/fit-connect/events/accept-submission"); + .Be(acceptSubmission); decoded.EventType.Should().Be(EventType.Accept); } @@ -54,7 +54,7 @@ public class SecurityEventTokenTests { Console.WriteLine(token); var decoded = new SecurityEventToken(token); decoded.Event?.Type.Should() - .Be("https://schema.fitko.de/fit-connect/events/reject-submission"); + .Be(rejectSubmission); decoded.EventType.Should().Be(EventType.Reject); } @@ -68,7 +68,7 @@ public class SecurityEventTokenTests { Console.WriteLine(token); var decoded = new SecurityEventToken(token); decoded.Event?.Type.Should() - .Be("https://schema.fitko.de/fit-connect/events/reject-submission"); + .Be(rejectSubmission); decoded.EventType.Should().Be(EventType.Reject); } @@ -83,7 +83,7 @@ public class SecurityEventTokenTests { Console.WriteLine(token); var decoded = new SecurityEventToken(token); decoded.Event?.Type.Should() - .Be("https://schema.fitko.de/fit-connect/events/reject-submission"); + .Be(rejectSubmission); decoded.EventType.Should().Be(EventType.Reject); } @@ -98,7 +98,7 @@ public class SecurityEventTokenTests { var decoded = new SecurityEventToken(token); decoded.Event?.Type.Should() - .Be("https://schema.fitko.de/fit-connect/events/reject-submission"); + .Be(rejectSubmission); decoded.EventType.Should().Be(EventType.Reject); } @@ -112,7 +112,7 @@ public class SecurityEventTokenTests { Console.WriteLine(token); var decoded = new SecurityEventToken(token); decoded.Event?.Type.Should() - .Be("https://schema.fitko.de/fit-connect/events/reject-submission"); + .Be(rejectSubmission); decoded.EventType.Should().Be(EventType.Reject); } @@ -126,22 +126,7 @@ public class SecurityEventTokenTests { Console.WriteLine(token); var decoded = new SecurityEventToken(token); decoded.Event?.Type.Should() - .Be("https://schema.fitko.de/fit-connect/events/reject-submission"); + .Be(rejectSubmission); decoded.EventType.Should().Be(EventType.Reject); } - - // [Test] - // public void CreateJwt_Reject_WithCustomProblem() { - // var token = _encryption.CreateSecurityEventToken(Guid.NewGuid().ToString(), - // Guid.NewGuid().ToString(), - // Guid.NewGuid().ToString(), - // "https://schema.fitko.de/fit-connect/events/reject-submission", - // new[] { new Problems { Description = "A real big issue" } } - // ); - // Console.WriteLine(token); - // var decoded = new SecurityEventToken(token); - // decoded.Event?.Type.Should() - // .Be("https://schema.fitko.de/fit-connect/events/reject-submission"); - // decoded.EventType.Should().Be(EventType.Reject); - // } } -- GitLab