public TestKey(string name, List <Stroke> pressStrokes, List <Stroke> releaseStrokes, ExpectedResult pressResult, ExpectedResult releaseResult) { Name = name; PressStrokes = pressStrokes; ReleaseStrokes = releaseStrokes; PressResult = pressResult; ReleaseResult = releaseResult; }
public void PressRelease(string name, List <Stroke> pressStrokes, List <Stroke> releaseStrokes, ExpectedResult pressResult, ExpectedResult releaseResult) { Debug.WriteLine($"\nTesting key {name}..."); Debug.WriteLine("Testing Press"); var expectedResult = pressResult; var actualResult = ScanCodeHelper.TranslateScanCodes(pressStrokes); AssertResult(actualResult, expectedResult); Debug.WriteLine("Testing Release"); expectedResult = releaseResult; actualResult = ScanCodeHelper.TranslateScanCodes(releaseStrokes); AssertResult(actualResult, expectedResult); Debug.WriteLine("OK!"); }
private static ExpectedResult Result(ushort code, ushort state) { var results = new ExpectedResult(code, state); return(results); }
void AssertResult(TranslatedKey actualResult, ExpectedResult expectedResult) { Debug.WriteLine($"Expecting code of {expectedResult.Code}, state of {expectedResult.State}"); Assert.That(actualResult.Code, Is.EqualTo(expectedResult.Code), $"Code should be {expectedResult.Code}, got {actualResult.Code}"); Assert.That(actualResult.State, Is.EqualTo(expectedResult.State), $"State should be {expectedResult.State}, got {actualResult.State}"); }