mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Move existing, unported tests to root for old test project
This commit is contained in:
98
SabreTools.Test/PopulationTests.cs
Normal file
98
SabreTools.Test/PopulationTests.cs
Normal file
@@ -0,0 +1,98 @@
|
||||
using System.Collections.Generic;
|
||||
using SabreTools.DatTools;
|
||||
using Xunit;
|
||||
|
||||
namespace SabreTools.Test
|
||||
{
|
||||
public class PopulationTests
|
||||
{
|
||||
[Fact]
|
||||
public void PopulateExclusionNullListTest()
|
||||
{
|
||||
// Setup the list
|
||||
List<string>? exclusions = null;
|
||||
|
||||
// Setup the remover
|
||||
var remover = new Remover();
|
||||
remover.PopulateExclusionsFromList(exclusions);
|
||||
|
||||
// Check the exclusion lists
|
||||
Assert.Empty(remover.HeaderFieldNames);
|
||||
Assert.Empty(remover.MachineFieldNames);
|
||||
Assert.Empty(remover.ItemFieldNames);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PopulateExclusionEmptyListTest()
|
||||
{
|
||||
// Setup the list
|
||||
List<string> exclusions = [];
|
||||
|
||||
// Setup the remover
|
||||
var remover = new Remover();
|
||||
remover.PopulateExclusionsFromList(exclusions);
|
||||
|
||||
// Check the exclusion lists
|
||||
Assert.Empty(remover.HeaderFieldNames);
|
||||
Assert.Empty(remover.MachineFieldNames);
|
||||
Assert.Empty(remover.ItemFieldNames);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PopulateExclusionHeaderFieldTest()
|
||||
{
|
||||
// Setup the list
|
||||
List<string> exclusions =
|
||||
[
|
||||
"header.datname",
|
||||
];
|
||||
|
||||
// Setup the remover
|
||||
var remover = new Remover();
|
||||
remover.PopulateExclusionsFromList(exclusions);
|
||||
|
||||
// Check the exclusion lists
|
||||
Assert.Empty(remover.HeaderFieldNames);
|
||||
Assert.Empty(remover.MachineFieldNames);
|
||||
Assert.Empty(remover.ItemFieldNames);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PopulateExclusionMachineFieldTest()
|
||||
{
|
||||
// Setup the list
|
||||
List<string> exclusions =
|
||||
[
|
||||
"machine.name",
|
||||
];
|
||||
|
||||
// Setup the remover
|
||||
var remover = new Remover();
|
||||
remover.PopulateExclusionsFromList(exclusions);
|
||||
|
||||
// Check the exclusion lists
|
||||
Assert.Empty(remover.HeaderFieldNames);
|
||||
Assert.Single(remover.MachineFieldNames);
|
||||
Assert.Empty(remover.ItemFieldNames);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PopulateExclusionDatItemFieldTest()
|
||||
{
|
||||
// Setup the list
|
||||
List<string> exclusions =
|
||||
[
|
||||
"item.name",
|
||||
];
|
||||
|
||||
// Setup the remover
|
||||
var remover = new Remover();
|
||||
remover.PopulateExclusionsFromList(exclusions);
|
||||
|
||||
// Check the exclusion lists
|
||||
Assert.Empty(remover.HeaderFieldNames);
|
||||
Assert.Empty(remover.MachineFieldNames);
|
||||
Assert.Single(remover.ItemFieldNames);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user