summaryrefslogtreecommitdiffstats
path: root/tests/IOL.Fagprove.Tests/PasswordHasherTests.cs
diff options
context:
space:
mode:
authorivar <i@oiee.no>2025-10-19 23:41:23 +0200
committerivar <i@oiee.no>2025-10-19 23:41:23 +0200
commit3f4c0720e1e3421431e7baa20882a4a4512a7fab (patch)
tree734ca81d7d0841d8863e3f523ebba14c282dc681 /tests/IOL.Fagprove.Tests/PasswordHasherTests.cs
downloadfagprove-3f4c0720e1e3421431e7baa20882a4a4512a7fab.tar.xz
fagprove-3f4c0720e1e3421431e7baa20882a4a4512a7fab.zip
InitialHEADmaster
Diffstat (limited to 'tests/IOL.Fagprove.Tests/PasswordHasherTests.cs')
-rw-r--r--tests/IOL.Fagprove.Tests/PasswordHasherTests.cs22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/IOL.Fagprove.Tests/PasswordHasherTests.cs b/tests/IOL.Fagprove.Tests/PasswordHasherTests.cs
new file mode 100644
index 0000000..90b7847
--- /dev/null
+++ b/tests/IOL.Fagprove.Tests/PasswordHasherTests.cs
@@ -0,0 +1,22 @@
+using System;
+using IOL.Fagprove.Utilities;
+using Xunit;
+
+namespace PIT.ReservationService.Tests
+{
+ public class PasswordHasherTests
+ {
+ [Fact]
+ public void ThrowsGivenEmptyString()
+ {
+ Assert.Throws<ArgumentException>(() => PasswordHasher.HashPassword(""));
+ }
+
+ [Fact]
+ public void WorksGivenNonEmptyString()
+ {
+ var passwordHash = PasswordHasher.HashPassword("alksjhfoiuq");
+ Assert.False(string.IsNullOrWhiteSpace(passwordHash));
+ }
+ }
+} \ No newline at end of file