Add scanner helper method tests

This commit is contained in:
Matt Nadareski
2024-12-02 11:50:34 -05:00
parent f71919f8f7
commit 254d2877b5

View File

@@ -0,0 +1,44 @@
using System.Collections.Generic;
using Xunit;
namespace BinaryObjectScanner.Test
{
public class ScannerTests
{
#region ProcessProtectionString
[Fact]
public void ProcessProtectionString_Null_Empty()
{
string? protection = null;
List<string> actual = Scanner.ProcessProtectionString(protection);
Assert.Empty(actual);
}
[Fact]
public void ProcessProtectionString_Empty_Empty()
{
string? protection = string.Empty;
List<string> actual = Scanner.ProcessProtectionString(protection);
Assert.Empty(actual);
}
[Fact]
public void ProcessProtectionString_NoIndicator_Single()
{
string? protection = "item1";
List<string> actual = Scanner.ProcessProtectionString(protection);
Assert.Single(actual);
}
[Fact]
public void ProcessProtectionString_Indicator_Multiple()
{
string? protection = "item1;item2";
List<string> actual = Scanner.ProcessProtectionString(protection);
Assert.Equal(2, actual.Count);
}
#endregion
}
}