File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
analyzers/tests/SonarAnalyzer.UnitTest/TestCases Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 1
1
using Microsoft . VisualStudio . TestTools . UnitTesting ;
2
2
using NUnit . Framework ;
3
+ using System ;
3
4
using System . Threading ;
4
5
using Xunit ;
5
6
using Alias = System . Threading . Thread ;
@@ -70,4 +71,10 @@ void Wait()
70
71
Thread . Sleep ( 42 ) ; // Noncompliant
71
72
}
72
73
}
74
+
75
+ [ Test ]
76
+ public void ThreadSleepInLambdaFunction ( )
77
+ {
78
+ Action sleep = ( ) => Thread . Sleep ( 42 ) ; // Noncompliant
79
+ }
73
80
}
Original file line number Diff line number Diff line change @@ -51,4 +51,8 @@ Class NonCompliant
51
51
Sleep( 42 ) ' Noncompliant
52
52
End Sub
53
53
54
+ <Test>
55
+ Public Sub ThreadSleepInLambdaFunction()
56
+ Dim sleep As Action = Sub () Thread.Sleep( 42 ) ' Noncompliant
57
+ End Sub
54
58
End Class
You can’t perform that action at this time.
0 commit comments