Skip to content

Commit 541ad2e

Browse files
authored
Update CommandTests.cs
1 parent 2a20b5f commit 541ad2e

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

RoboSharpUnitTesting/CommandTests.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,9 @@ internal static class SourceTree
6565
[TestClass]
6666
public class RoboCommand_Tests : CommandTests<RoboCommand>
6767
{
68-
protected override RoboCommand GetCommand(string source, string destination)
68+
protected override RoboCommand GetCommand()
6969
{
70-
var cmd = new RoboCommand();
71-
cmd.CopyOptions.Source = source;
72-
cmd.CopyOptions.Destination = destination;
73-
return cmd;
70+
return new RoboCommand();
7471
}
7572
}
7673

@@ -142,13 +139,15 @@ public void TestCleanup()
142139
/// The base implementation uses <see cref="Activator.CreateInstance{T}"/> and
143140
/// wires Source + Destination on <see cref="IRoboCommand.CopyOptions"/>.
144141
/// </summary>
145-
protected virtual T GetCommand(string source, string destination)
142+
protected T GetCommand(string source, string destination)
146143
{
147-
var cmd = Activator.CreateInstance<T>();
144+
var cmd = GetCommand();
148145
cmd.CopyOptions.Source = source;
149146
cmd.CopyOptions.Destination = destination;
150147
return cmd;
151148
}
149+
/// <inheritdoc cref="GetCommand(string,string)"/>
150+
protected virtual T GetCommand() => Activator.CreateInstance<T>();
152151

153152
// ── Run helper ────────────────────────────────────────────────────────
154153

0 commit comments

Comments
 (0)