Example #1
0
 public UsingCookies(IAnalyzerConfiguration analyzerConfiguration) : base(RspecStrings.ResourceManager)
 {
     PropertyAccessTracker = new VisualBasicPropertyAccessTracker(analyzerConfiguration, Rule);
     ElementAccessTracker  = new VisualBasicElementAccessTracker(analyzerConfiguration, Rule);
     ObjectCreationTracker = new VisualBasicObjectCreationTracker(analyzerConfiguration, Rule);
     InvocationTracker     = new VisualBasicInvocationTracker(analyzerConfiguration, Rule);
 }
Example #2
0
 public UsingCookies(IAnalyzerConfiguration analyzerConfiguration)
 {
     PropertyAccessTracker = new VisualBasicPropertyAccessTracker(analyzerConfiguration, rule);
     ElementAccessTracker  = new VisualBasicElementAccessTracker(analyzerConfiguration, rule);
     ObjectCreationTracker = new VisualBasicObjectCreationTracker(analyzerConfiguration, rule);
     InvocationTracker     = new VisualBasicInvocationTracker(analyzerConfiguration, rule);
 }
        public void ArgumentAtIndexEquals_VB()
        {
            var context = CreateContext <VBSyntax.InvocationExpressionSyntax>(TestInputVB, 0, AnalyzerLanguage.VisualBasic);
            var tracker = new VisualBasicElementAccessTracker();

            tracker.ArgumentAtIndexEquals(0, "key")(context).Should().BeTrue();
            tracker.ArgumentAtIndexEquals(0, "foo")(context).Should().BeFalse();
            tracker.ArgumentAtIndexEquals(42, "key")(context).Should().BeFalse();

            context = CreateContext <VBSyntax.InvocationExpressionSyntax>(TestInputVB, 1, AnalyzerLanguage.VisualBasic);
            tracker.ArgumentAtIndexEquals(0, "key")(context).Should().BeTrue();
            tracker.ArgumentAtIndexEquals(0, "foo")(context).Should().BeFalse();
            tracker.ArgumentAtIndexEquals(42, "key")(context).Should().BeFalse();

            context = CreateContext <VBSyntax.InvocationExpressionSyntax>(TestInputVB, 2, AnalyzerLanguage.VisualBasic);
            tracker.ArgumentAtIndexEquals(0, "key")(context).Should().BeFalse();
            tracker.ArgumentAtIndexEquals(0, "foo")(context).Should().BeFalse();
            tracker.ArgumentAtIndexEquals(42, "key")(context).Should().BeFalse();

            context = CreateContext <VBSyntax.InvocationExpressionSyntax>(TestInputVB, 3, AnalyzerLanguage.VisualBasic);
            tracker.ArgumentAtIndexEquals(0, "key")(context).Should().BeFalse();
        }