github
3050 of 4397 new or added lines in 192 files covered. (69.37%)
75 existing lines in 20 files now uncovered.7070 of 8583 relevant lines covered (82.37%)
17.24 hits per line
1 |
namespace BusinessLogic.Commands;
|
|
2 |
|
|
3 |
public class BatchCommand : IBatchCommand |
|
4 |
{ |
|
NEW
|
public string Name => nameof(BatchCommand); |
× |
6 |
internal IEnumerable<IUndoCommand> Commands { get; } |
|
7 |
|
|
8 |
public BatchCommand(IEnumerable<IUndoCommand> commands)
|
1✔ |
9 |
{ |
1✔ |
10 |
Commands = commands; |
1✔ |
11 |
} |
1✔ |
12 |
|
|
13 |
public void Execute() |
|
14 |
{ |
1✔ |
15 |
foreach (var command in Commands) |
9✔ |
16 |
{ |
3✔ |
17 |
command.Execute(); |
3✔ |
18 |
} |
3✔ |
19 |
} |
1✔ |
20 |
|
|
21 |
public void Undo() |
|
22 |
{ |
1✔ |
23 |
foreach (var command in Commands.Reverse()) |
9✔ |
24 |
{ |
3✔ |
25 |
command.Undo(); |
3✔ |
26 |
} |
3✔ |
27 |
} |
1✔ |
28 |
|
|
29 |
public void Redo() |
|
30 |
{ |
1✔ |
31 |
foreach (var command in Commands) |
9✔ |
32 |
{ |
3✔ |
33 |
command.Redo(); |
3✔ |
34 |
} |
3✔ |
35 |
} |
1✔ |
36 |
} |