Move GetDuplicateSuffix to where it's used

This commit is contained in:
Matt Nadareski
2025-05-02 20:19:56 -04:00
parent f38fe9b007
commit df21af5682
10 changed files with 369 additions and 555 deletions

View File

@@ -1988,176 +1988,5 @@ namespace SabreTools.Core.Test
}
#endregion
#region GetDuplicateSuffix
[Fact]
public void GetDuplicateSuffix_Disk_NoHash_Generic()
{
DictionaryBase self = new Disk();
string actual = self.GetDuplicateSuffix();
Assert.Equal("_1", actual);
}
[Fact]
public void GetDuplicateSuffix_Disk_MD5()
{
string hash = "XXXXXX";
DictionaryBase self = new Disk { [Disk.MD5Key] = hash };
string actual = self.GetDuplicateSuffix();
Assert.Equal($"_{hash}", actual);
}
[Fact]
public void GetDuplicateSuffix_Disk_SHA1()
{
string hash = "XXXXXX";
DictionaryBase self = new Disk { [Disk.SHA1Key] = hash };
string actual = self.GetDuplicateSuffix();
Assert.Equal($"_{hash}", actual);
}
[Fact]
public void GetDuplicateSuffix_Media_NoHash_Generic()
{
DictionaryBase self = new Media();
string actual = self.GetDuplicateSuffix();
Assert.Equal("_1", actual);
}
[Fact]
public void GetDuplicateSuffix_Media_MD5()
{
string hash = "XXXXXX";
DictionaryBase self = new Media { [Media.MD5Key] = hash };
string actual = self.GetDuplicateSuffix();
Assert.Equal($"_{hash}", actual);
}
[Fact]
public void GetDuplicateSuffix_Media_SHA1()
{
string hash = "XXXXXX";
DictionaryBase self = new Media { [Media.SHA1Key] = hash };
string actual = self.GetDuplicateSuffix();
Assert.Equal($"_{hash}", actual);
}
[Fact]
public void GetDuplicateSuffix_Media_SHA256()
{
string hash = "XXXXXX";
DictionaryBase self = new Media { [Media.SHA256Key] = hash };
string actual = self.GetDuplicateSuffix();
Assert.Equal($"_{hash}", actual);
}
[Fact]
public void GetDuplicateSuffix_Media_SpamSum()
{
string hash = "XXXXXX";
DictionaryBase self = new Media { [Media.SpamSumKey] = hash };
string actual = self.GetDuplicateSuffix();
Assert.Equal($"_{hash}", actual);
}
[Fact]
public void GetDuplicateSuffix_Rom_NoHash_Generic()
{
DictionaryBase self = new Rom();
string actual = self.GetDuplicateSuffix();
Assert.Equal("_1", actual);
}
[Fact]
public void GetDuplicateSuffix_Rom_CRC()
{
string hash = "XXXXXX";
DictionaryBase self = new Rom { [Rom.CRCKey] = hash };
string actual = self.GetDuplicateSuffix();
Assert.Equal($"_{hash}", actual);
}
[Fact]
public void GetDuplicateSuffix_Rom_MD2()
{
string hash = "XXXXXX";
DictionaryBase self = new Rom { [Rom.MD2Key] = hash };
string actual = self.GetDuplicateSuffix();
Assert.Equal($"_{hash}", actual);
}
[Fact]
public void GetDuplicateSuffix_Rom_MD4()
{
string hash = "XXXXXX";
DictionaryBase self = new Rom { [Rom.MD4Key] = hash };
string actual = self.GetDuplicateSuffix();
Assert.Equal($"_{hash}", actual);
}
[Fact]
public void GetDuplicateSuffix_Rom_MD5()
{
string hash = "XXXXXX";
DictionaryBase self = new Rom { [Rom.MD5Key] = hash };
string actual = self.GetDuplicateSuffix();
Assert.Equal($"_{hash}", actual);
}
[Fact]
public void GetDuplicateSuffix_Rom_SHA1()
{
string hash = "XXXXXX";
DictionaryBase self = new Rom { [Rom.SHA1Key] = hash };
string actual = self.GetDuplicateSuffix();
Assert.Equal($"_{hash}", actual);
}
[Fact]
public void GetDuplicateSuffix_Rom_SHA256()
{
string hash = "XXXXXX";
DictionaryBase self = new Rom { [Rom.SHA256Key] = hash };
string actual = self.GetDuplicateSuffix();
Assert.Equal($"_{hash}", actual);
}
[Fact]
public void GetDuplicateSuffix_Rom_SHA384()
{
string hash = "XXXXXX";
DictionaryBase self = new Rom { [Rom.SHA384Key] = hash };
string actual = self.GetDuplicateSuffix();
Assert.Equal($"_{hash}", actual);
}
[Fact]
public void GetDuplicateSuffix_Rom_SHA512()
{
string hash = "XXXXXX";
DictionaryBase self = new Rom { [Rom.SHA512Key] = hash };
string actual = self.GetDuplicateSuffix();
Assert.Equal($"_{hash}", actual);
}
[Fact]
public void GetDuplicateSuffix_Rom_SpamSum()
{
string hash = "XXXXXX";
DictionaryBase self = new Rom { [Rom.SpamSumKey] = hash };
string actual = self.GetDuplicateSuffix();
Assert.Equal($"_{hash}", actual);
}
[Fact]
public void GetDuplicateSuffix_Other_Generic()
{
DictionaryBase self = new Sample();
string actual = self.GetDuplicateSuffix();
Assert.Equal("_1", actual);
}
#endregion
}
}