public void Test_AdditionAndSubtractionOperators_WithOne_ChangesOpCode() { //Arrange var mutator = new IncrementAndDecrementMutator(); //Act mutator.MutateType(this.Instructions); //Assert Assert.Equal(OpCodes.Sub, this.Instructions[97].OpCode); Assert.Equal(OpCodes.Add, this.Instructions[101].OpCode); }
public void Test_PlusEqualsAndMinusEqualsOperators_WithOne_ChangesOpCode() { //Arrange var mutator = new IncrementAndDecrementMutator(); //Act mutator.MutateType(this.Instructions); //Assert Assert.Equal(OpCodes.Sub, this.Instructions[85].OpCode); Assert.Equal(OpCodes.Add, this.Instructions[89].OpCode); }
public void Test_DecrementInMethod_ChangesOpCode() { //Arrange var mutator = new IncrementAndDecrementMutator(); //Act mutator.MutateType(this.Instructions); //Assert Assert.Equal(OpCodes.Add, this.Instructions[45].OpCode); Assert.Equal(OpCodes.Add, this.Instructions[49].OpCode); }
public void Test_DecrementInProperty_ChangesOpCode() { //Arrange var mutator = new IncrementAndDecrementMutator(); //Act mutator.MutateType(this.Instructions); //Assert Assert.Equal(OpCodes.Add, this.Instructions[57].OpCode); Assert.Equal(OpCodes.Add, this.Instructions[61].OpCode); Assert.Equal(OpCodes.Add, this.Instructions[73].OpCode); Assert.Equal(OpCodes.Add, this.Instructions[77].OpCode); }
public void Test_AddAndSub_NotAddingOrSubtractingOne_DoesntChangeOpCode() { //Arrange var mutator = new IncrementAndDecrementMutator(); //Act mutator.MutateType(this.Instructions); //Assert Assert.Equal(OpCodes.Add, this.Instructions[109].OpCode); Assert.Equal(OpCodes.Add, this.Instructions[113].OpCode); Assert.Equal(OpCodes.Sub, this.Instructions[117].OpCode); Assert.Equal(OpCodes.Sub, this.Instructions[121].OpCode); }