-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathEnumExtensionsTests.cs
More file actions
26 lines (23 loc) · 901 Bytes
/
Copy pathEnumExtensionsTests.cs
File metadata and controls
26 lines (23 loc) · 901 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using BorgMate.Models;
namespace BorgMate.Tests;
public class EnumExtensionsTests
{
[Theory]
[InlineData(BorgEncryptionMode.None, "none")]
[InlineData(BorgEncryptionMode.Repokey, "repokey")]
[InlineData(BorgEncryptionMode.RepokeyBlake2, "repokey-blake2")]
[InlineData(BorgEncryptionMode.Keyfile, "keyfile")]
[InlineData(BorgEncryptionMode.KeyfileBlake2, "keyfile-blake2")]
[InlineData(BorgEncryptionMode.Authenticated, "authenticated")]
[InlineData(BorgEncryptionMode.AuthenticatedBlake2, "authenticated-blake2")]
public void ToBorgString_ReturnsCorrectValue(BorgEncryptionMode mode, string expected)
{
Assert.Equal(expected, mode.ToBorgString());
}
[Fact]
public void ToBorgString_InvalidValue_ReturnsFallback()
{
var invalid = (BorgEncryptionMode)999;
Assert.Equal("repokey-blake2", invalid.ToBorgString());
}
}