Skip to content

Commit

Permalink
Fixed compiler errors in Desktop.Analyzers.UnitTests (#1005)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkoelman authored and mavasani committed May 18, 2016
1 parent 3410300 commit 19d67c8
Show file tree
Hide file tree
Showing 30 changed files with 254 additions and 175 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ private async Task TestMethod()

VerifyBasic(@"
Imports System.Security.Cryptography
Imports System.Threading.Tasks
Module TestClass
Public Async Sub TestMethod()
Expand All @@ -160,7 +161,7 @@ Return New HMACMD5()
End Function)
End Sub
End Module",
GetBasicResultAt(7, 35, s_CA5351Rule, "TestMethod", "HMACMD5"));
GetBasicResultAt(8, 35, s_CA5351Rule, "Run", "HMACMD5"));
}

[Fact]
Expand Down Expand Up @@ -296,7 +297,7 @@ Imports System.Security.Cryptography
Imports System.Threading.Tasks
Namespace TestNamespace
Class TestClass
Private Function TestMethod() As Task
Private Async Function TestMethod() As Task
Await Task.Run(Function()
DES.Create()
End Function)
Expand Down Expand Up @@ -518,6 +519,7 @@ End Class
End Namespace",
//Test1
@"
Imports System
Imports System.Security.Cryptography
Namespace TestNamespace
Class MyDES
Expand Down Expand Up @@ -727,6 +729,7 @@ End Class
End Namespace",
//Test1
@"
Imports System
Imports System.Security.Cryptography
Namespace TestNamespace
Class MyRC2
Expand Down Expand Up @@ -1068,6 +1071,7 @@ End Class

//Test1
@"
Imports System
Imports System.Security.Cryptography
Namespace TestNamespace
Expand Down Expand Up @@ -1523,6 +1527,8 @@ End Class
End Namespace",
//Test1
@"
Imports System
Imports System.Security
Imports System.Security.Cryptography
Namespace TestNamespace
Class MyRIPEMD160
Expand Down Expand Up @@ -1601,6 +1607,7 @@ End Class
End Namespace",
//Test1
@"
Imports System
Imports System.Security.Cryptography
Namespace TestNamespace
Class MyRIPEMD160
Expand Down Expand Up @@ -1880,6 +1887,7 @@ End Class
End Namespace",
//Test1
@"
Imports System
Imports System.Security.Cryptography
Namespace TestNamespace
Expand Down Expand Up @@ -2099,6 +2107,7 @@ End Class
End Namespace",
//Test1
@"
Imports System
Imports System.Security.Cryptography
Namespace TestNamespace
Class MyRijndael
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ private void TestMethod()
);

VerifyBasic(@"
Imports System
Imports System.Xml
Class TestClass6a
Expand All @@ -242,7 +243,7 @@ Catch generatedExceptionName As Exception
End Try
End Sub
End Class",
GetCA3075XmlReaderCreateInsecureInputBasicResultAt(9, 26)
GetCA3075XmlReaderCreateInsecureInputBasicResultAt(10, 26)
);
}

Expand Down Expand Up @@ -271,6 +272,7 @@ private void TestMethod()
);

VerifyBasic(@"
Imports System
Imports System.Xml
Class TestClass6a
Expand All @@ -284,7 +286,7 @@ Catch generatedExceptionName As Exception
End Try
End Sub
End Class",
GetCA3075XmlReaderCreateInsecureInputBasicResultAt(10, 26)
GetCA3075XmlReaderCreateInsecureInputBasicResultAt(11, 26)
);
}

Expand Down Expand Up @@ -313,6 +315,7 @@ private void TestMethod()
);

VerifyBasic(@"
Imports System
Imports System.Xml
Class TestClass6a
Expand All @@ -327,7 +330,7 @@ Catch generatedExceptionName As Exception
End Try
End Sub
End Class",
GetCA3075XmlReaderCreateInsecureInputBasicResultAt(12, 26)
GetCA3075XmlReaderCreateInsecureInputBasicResultAt(13, 26)
);
}

Expand Down Expand Up @@ -372,7 +375,7 @@ Await Task.Run(Function()
End Function)
End Function
Private Sub TestMethod2()
Private Async Sub TestMethod2()
Await TestMethod()
End Sub
End Class",
Expand Down Expand Up @@ -542,6 +545,7 @@ public static string TestMethod(string inputRule)
);

VerifyBasic(@"
Imports System
Imports System.IO
Imports System.Xml
Expand Down Expand Up @@ -578,7 +582,7 @@ Return outputRule
End Function
End Class
End Namespace",
GetCA3075XmlDocumentWithNoSecureResolverBasicResultAt(10, 31)
GetCA3075XmlDocumentWithNoSecureResolverBasicResultAt(11, 31)
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ private void TestMethod()
);

VerifyBasic(@"
Imports System
Imports System.Xml
Class TestClass
Expand All @@ -201,7 +202,7 @@ Catch generatedExceptionName As Exception
End Try
End Sub
End Class",
GetCA3075LoadXmlBasicResultAt(11, 13)
GetCA3075LoadXmlBasicResultAt(12, 13)
);
}

Expand Down Expand Up @@ -230,6 +231,7 @@ private void TestMethod()
);

VerifyBasic(@"
Imports System
Imports System.Xml
Class TestClass
Expand All @@ -245,7 +247,7 @@ Dim doc As New XmlDocument() With { _
End Try
End Sub
End Class",
GetCA3075LoadXmlBasicResultAt(12, 13)
GetCA3075LoadXmlBasicResultAt(13, 13)
);
}

Expand Down Expand Up @@ -274,6 +276,7 @@ private void TestMethod()
);

VerifyBasic(@"
Imports System
Imports System.Xml
Class TestClass
Expand All @@ -290,7 +293,7 @@ Dim doc As New XmlDocument() With { _
End Try
End Sub
End Class",
GetCA3075LoadXmlBasicResultAt(14, 13)
GetCA3075LoadXmlBasicResultAt(15, 13)
);
}

Expand Down Expand Up @@ -336,7 +339,7 @@ Dim doc As New XmlDocument() With { _
End Function)
End Function
Private Sub TestMethod2()
Private Async Sub TestMethod2()
Await TestMethod()
End Sub
End Class",
Expand Down Expand Up @@ -458,6 +461,7 @@ private void TestMethod()
);

VerifyBasic(@"
Imports System
Imports System.Xml
Class TestClass
Expand All @@ -474,7 +478,7 @@ Catch generatedExceptionName As Exception
End Try
End Sub
End Class",
GetCA3075LoadXmlBasicResultAt(11, 13)
GetCA3075LoadXmlBasicResultAt(12, 13)
);
}

Expand Down Expand Up @@ -503,6 +507,7 @@ private void TestMethod()
);

VerifyBasic(@"
Imports System
Imports System.Xml
Class TestClass
Expand All @@ -518,7 +523,7 @@ Dim doc As New XmlDataDocument() With { _
End Try
End Sub
End Class",
GetCA3075LoadXmlBasicResultAt(12, 13)
GetCA3075LoadXmlBasicResultAt(13, 13)
);
}

Expand Down Expand Up @@ -547,6 +552,7 @@ private void TestMethod()
);

VerifyBasic(@"
Imports System
Imports System.Xml
Class TestClass
Expand All @@ -563,7 +569,7 @@ Dim doc As New XmlDataDocument() With { _
End Try
End Sub
End Class",
GetCA3075LoadXmlBasicResultAt(14, 13)
GetCA3075LoadXmlBasicResultAt(15, 13)
);
}

Expand Down Expand Up @@ -609,7 +615,7 @@ Dim doc As New XmlDataDocument() With { _
End Function)
End Function
Private Sub TestMethod2()
Private Async Sub TestMethod2()
Await TestMethod()
End Sub
End Class",
Expand Down Expand Up @@ -659,7 +665,7 @@ Dim doc As New XmlDataDocument() With { _
End Function)
End Function
Private Sub TestMethod2()
Private Async Sub TestMethod2()
Await TestMethod()
End Sub
End Class",
Expand Down
Loading

0 comments on commit 19d67c8

Please sign in to comment.