Ensure Dispose is called on Emulator instance
This commit is contained in:
parent
c4b2e88921
commit
ca641f8b13
1 changed files with 13 additions and 11 deletions
|
|
@ -189,20 +189,22 @@ namespace MatterHackers.MatterControl.Tests.Automation
|
|||
|
||||
private static void SimulatePrint(string[] sendRecieveLog)
|
||||
{
|
||||
Emulator emulator = new Emulator();
|
||||
int lineIndex = 0;
|
||||
while (lineIndex < sendRecieveLog.Length)
|
||||
using (var emulator = new Emulator())
|
||||
{
|
||||
var sentCommand = sendRecieveLog[lineIndex];
|
||||
string response = emulator.GetCorrectResponse(sentCommand);
|
||||
lineIndex++;
|
||||
var lines = response.Split('\n');
|
||||
for (int i = 0; i < lines.Length; i++)
|
||||
int lineIndex = 0;
|
||||
while (lineIndex < sendRecieveLog.Length)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(lines[i]))
|
||||
var sentCommand = sendRecieveLog[lineIndex];
|
||||
string response = emulator.GetCorrectResponse(sentCommand);
|
||||
lineIndex++;
|
||||
var lines = response.Split('\n');
|
||||
for (int i = 0; i < lines.Length; i++)
|
||||
{
|
||||
Assert.AreEqual(sendRecieveLog[lineIndex], lines[i]);
|
||||
lineIndex++;
|
||||
if (!string.IsNullOrEmpty(lines[i]))
|
||||
{
|
||||
Assert.AreEqual(sendRecieveLog[lineIndex], lines[i]);
|
||||
lineIndex++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue