Created
April 16, 2025 16:16
-
-
Save cander/828ef36689f26ec9773f0b9e3e8cd30b to your computer and use it in GitHub Desktop.
Unit test re-implementing logic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void AssignmentExampleTest() | |
{ | |
// Arrange | |
var robot = new SquareRobot(); | |
var commands = new int[] { 4, 4, 3, 2, 2, 3 }; | |
// Act | |
var result = robot.Move(commands); | |
// Assert | |
Assert.True(result); | |
bool answ = false; | |
for (int i = 0; i < commands.Length; i++) | |
{ | |
if (i >= 3) | |
{ | |
if (commands[i] >= commands[i - 2]) | |
{ | |
answ = true; | |
break; | |
} | |
} | |
} | |
Assert.True(answ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment