コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }