mirror of
https://github.com/SabreTools/MPF.git
synced 2026-07-02 17:24:48 +00:00
Fix tests, like the TODO said
This commit is contained in:
@@ -6,7 +6,7 @@ namespace DICUI.Data
|
||||
{
|
||||
public class Options : IDictionary<string, string>
|
||||
{
|
||||
private Dictionary<string, string> _settings = new Dictionary<string, string>();
|
||||
private Dictionary<string, string> _settings;
|
||||
|
||||
#region Internal Program
|
||||
|
||||
@@ -181,7 +181,7 @@ namespace DICUI.Data
|
||||
/// <param name="settings"></param>
|
||||
public Options(Dictionary<string, string> settings = null)
|
||||
{
|
||||
this._settings = settings;
|
||||
this._settings = settings ?? new Dictionary<string, string>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -141,12 +141,6 @@ namespace DICUI.Utilities
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Empty constructor for testing only
|
||||
/// </summary>
|
||||
/// TODO: Remove this and fix tests
|
||||
public DumpEnvironment() { }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for a full DumpEnvironment object from user information
|
||||
/// </summary>
|
||||
|
||||
@@ -16,14 +16,12 @@ namespace DICUI.Test
|
||||
[InlineData("stop D", 'D', false, MediaType.DVD, true)]
|
||||
public void ParametersValidTest(string parameters, char letter, bool isFloppy, MediaType? mediaType, bool expected)
|
||||
{
|
||||
var env = new DumpEnvironment
|
||||
{
|
||||
Parameters = new DiscImageCreator.Parameters(parameters),
|
||||
Drive = isFloppy
|
||||
? new Drive(InternalDriveType.Floppy, new DriveInfo(letter.ToString()))
|
||||
: new Drive(InternalDriveType.Optical, new DriveInfo(letter.ToString())),
|
||||
Type = mediaType,
|
||||
};
|
||||
var options = new Options() { InternalProgram = "dic" };
|
||||
var drive = isFloppy
|
||||
? new Drive(InternalDriveType.Floppy, new DriveInfo(letter.ToString()))
|
||||
: new Drive(InternalDriveType.Optical, new DriveInfo(letter.ToString()));
|
||||
|
||||
var env = new DumpEnvironment(options, string.Empty, string.Empty, drive, KnownSystem.IBMPCCompatible, mediaType, parameters);
|
||||
|
||||
bool actual = env.ParametersValid();
|
||||
Assert.Equal(expected, actual);
|
||||
@@ -40,11 +38,8 @@ namespace DICUI.Test
|
||||
[InlineData("superhero", "blah&foo.bin", "superhero", "blah&foo.bin")]
|
||||
public void FixOutputPathsTest(string outputDirectory, string outputFilename, string expectedOutputDirectory, string expectedOutputFilename)
|
||||
{
|
||||
var env = new DumpEnvironment
|
||||
{
|
||||
OutputDirectory = outputDirectory,
|
||||
OutputFilename = outputFilename,
|
||||
};
|
||||
var options = new Options() { InternalProgram = "dic" };
|
||||
var env = new DumpEnvironment(options, outputDirectory, outputFilename, null, KnownSystem.IBMPCCompatible, MediaType.CDROM, string.Empty);
|
||||
|
||||
env.FixOutputPaths();
|
||||
Assert.Equal(expectedOutputDirectory, env.OutputDirectory);
|
||||
|
||||
Reference in New Issue
Block a user