2024-12-02 11:50:34 -05:00
|
|
|
using System.Collections.Generic;
|
2025-09-06 12:40:06 -04:00
|
|
|
using BinaryObjectScanner.Data;
|
2024-12-02 11:50:34 -05:00
|
|
|
using Xunit;
|
|
|
|
|
|
2025-09-06 12:40:06 -04:00
|
|
|
namespace BinaryObjectScanner.Test.Data
|
2024-12-02 11:50:34 -05:00
|
|
|
{
|
2024-12-03 03:09:52 -05:00
|
|
|
public class ProtectionDictionaryTests
|
2024-12-02 11:50:34 -05:00
|
|
|
{
|
|
|
|
|
#region ProcessProtectionString
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void ProcessProtectionString_Null_Empty()
|
|
|
|
|
{
|
|
|
|
|
string? protection = null;
|
2024-12-03 03:09:52 -05:00
|
|
|
List<string> actual = ProtectionDictionary.ProcessProtectionString(protection);
|
2024-12-02 11:50:34 -05:00
|
|
|
Assert.Empty(actual);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void ProcessProtectionString_Empty_Empty()
|
|
|
|
|
{
|
|
|
|
|
string? protection = string.Empty;
|
2024-12-03 03:09:52 -05:00
|
|
|
List<string> actual = ProtectionDictionary.ProcessProtectionString(protection);
|
2024-12-02 11:50:34 -05:00
|
|
|
Assert.Empty(actual);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void ProcessProtectionString_NoIndicator_Single()
|
|
|
|
|
{
|
|
|
|
|
string? protection = "item1";
|
2024-12-03 03:09:52 -05:00
|
|
|
List<string> actual = ProtectionDictionary.ProcessProtectionString(protection);
|
2024-12-02 11:50:34 -05:00
|
|
|
Assert.Single(actual);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void ProcessProtectionString_Indicator_Multiple()
|
|
|
|
|
{
|
|
|
|
|
string? protection = "item1;item2";
|
2024-12-03 03:09:52 -05:00
|
|
|
List<string> actual = ProtectionDictionary.ProcessProtectionString(protection);
|
2024-12-02 11:50:34 -05:00
|
|
|
Assert.Equal(2, actual.Count);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
2025-11-07 08:24:22 -05:00
|
|
|
}
|