public void MutatorGeneratesNullWhenIndexOutOfRange(string fromOp, string toOp, int occurence, params string[] instructionsAsString) { // Arrange var program = new Program(instructionsAsString); // Act var result = OpSwapMutator.Mutate(program, fromOp, toOp, occurence); // Assert result.Should().Be(null); }
public void MutatorGeneratesCorrectMutation(string fromOp, string toOp, int occurence, int updatedIndex, params string[] instructionsAsString) { // Arrange var program = new Program(instructionsAsString); // Act var result = OpSwapMutator.Mutate(program, fromOp, toOp, occurence); // Assert result.ProgrammInstructions[updatedIndex].Operation.Should().Be(toOp); }