public void Method_ModifiedParameters_HasSideEffect()
        {
            const string methodParameter = "param1";
            var          body            = MockBlock.GetMethodBodyThatModifiedMethodParameters(methodParameter);
            var          method          = MockMethod.DefaultMethodWithBody(body);

            var sideEffectChecker = new ModifiedStateSideEffect();

            sideEffectChecker.CheckForSideEffects(method);
            var hasSideEffect = sideEffectChecker.HasSideEffects();

            Assert.IsTrue(hasSideEffect);
        }
        public void Method_ModifiedParameters_HasAnalyzerError()
        {
            var sideEffectRule = QualityRules.SideEffect;

            var classFields = "field1";
            var body        = MockBlock.GetMethodBodyThatModifiedMethodParameters(classFields);
            var method      = MockMethod.DefaultMethodWithBody(body);

            var sideEffectAnalyzer = new MethodSideEffects(TestBootStrapped.GetInstanceOfISideEffect());

            sideEffectAnalyzer.Analyze(method);
            var analyzeResult = sideEffectAnalyzer.GetResult();

            var hasSideEffect = analyzeResult.Any(a => a.ViolatedRule.Equals(sideEffectRule));

            Assert.IsTrue(hasSideEffect);
        }