Esempio n. 1
0
        public void BooleanConstant_PreMutation(bool expected, string constant)
        {
            // Arrange
            var binary = DllTestHelper.CompileTestBinary(folder);

            // Act
            using (var binaryInteractor = new DllTestHelper(binary))
            {
                var actual = binaryInteractor.GetField(nameSpace, constant);
                // Assert
                Assert.AreEqual(expected, actual);
            }
        }
Esempio n. 2
0
        public void IntConstant_PreMutation_Is_1()
        {
            // Arrange
            var binary   = DllTestHelper.CompileTestBinary(folder);
            var expected = 1;

            // Act
            using (var binaryInteractor = new DllTestHelper(binary))
            {
                var actual = binaryInteractor.GetField(nameSpace, ConstantIntName);

                // Assert
                Assert.AreEqual(expected, actual);
            }
        }
Esempio n. 3
0
        public void StringConstantTwoCharacters_PreMutation_Is_AB()
        {
            // Arrange
            var binary   = DllTestHelper.CompileTestBinary(folder);
            var expected = "AB";

            // Act
            using (var binaryInteractor = new DllTestHelper(binary))
            {
                var actual = binaryInteractor.GetField(nameSpace, ConstantStringTwoCharactersName);

                // Assert
                Assert.AreEqual(expected, actual);
            }
        }
Esempio n. 4
0
        public void ByteConstant_PostMutation_IsNot_240()
        {
            // Arrange
            var  binary   = DllTestHelper.CompileTestBinary(folder);
            byte expected = 240;

            // Act
            var mutatedBinary = DllTestHelper.MutateConstant <NumberConstantMutationAnalyzer>(binary, ConstantByteName);

            using (var binaryInteractor = new DllTestHelper(mutatedBinary))
            {
                var actual = binaryInteractor.GetField(nameSpace, ConstantByteName);

                // Assert
                Assert.AreNotEqual(expected, actual);
            }
        }
Esempio n. 5
0
        public void BooleanConstant_PostMutation_FalseToTrue()
        {
            // Arrange
            var binary   = DllTestHelper.CompileTestBinary(folder);
            var expected = true;

            // Act
            var mutatedBinary =
                DllTestHelper.MutateField <BooleanConstantMutationAnalyzer>(binary, ConstantBoolFalseName, true);

            using (var binaryInteractor = new DllTestHelper(mutatedBinary))
            {
                var actual = binaryInteractor.GetField(nameSpace, ConstantBoolTrueName);

                // Assert
                Assert.AreEqual(expected, actual);
            }
        }
Esempio n. 6
0
        public void StringConstantTwoCharacters_PostMutation_IsNot_AB()
        {
            // Arrange
            var binary   = DllTestHelper.CompileTestBinary(folder);
            var expected = "AB";

            // Act
            var mutatedBinary =
                DllTestHelper.MutateConstant <StringConstantMutationAnalyzer>(binary, ConstantStringTwoCharactersName);

            using (var binaryInteractor = new DllTestHelper(mutatedBinary))
            {
                var actual = binaryInteractor.GetField(nameSpace, ConstantStringTwoCharactersName);

                // Assert
                Assert.AreNotEqual(expected, actual);
            }
        }