Skip to content

Commit

Permalink
Mitigate CA1825 violation, update supporting tests (efcore#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
InteXX authored Mar 11, 2024
1 parent 608e957 commit 6c7cc26
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions EFCore.VisualBasic/Design/Internal/VisualBasicHelper.vb
Original file line number Diff line number Diff line change
Expand Up @@ -516,9 +516,9 @@ Namespace Design.Internal

If valuesList.Count = 0 Then
builder.
Append("New ").
Append("System.Array.Empty(Of ").
Append(Reference(type)).
Append("() {}")
Append(")")
Else

Dim byteArray As Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Namespace Design.Internal
Public Sub Literal_works_when_empty_ByteArray()
Literal_works(
New Byte() {},
"New Byte() {}")
"System.Array.Empty(Of Byte)")
End Sub

<ConditionalFact>
Expand Down Expand Up @@ -350,7 +350,7 @@ $"multi-line{nl}string with """,
<ConditionalFact>
Public Sub Literal_works_when_empty_StringArray()
Dim literal = New VisualBasicHelper(TypeMappingSource).Literal(New String() {})
Assert.Equal("New String() {}", literal)
Assert.Equal("System.Array.Empty(Of String)", literal)
End Sub

<ConditionalFact>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2624,7 +2624,7 @@ mb.Sql(""-- close to me"")"
"mb.InsertData(
table:=""People"",
column:=""Tags"",
value:=New String() {})"
value:=System.Array.Empty(Of String))"

Test(operation,
expectedCode,
Expand All @@ -2651,7 +2651,7 @@ mb.Sql(""-- close to me"")"
"mb.InsertData(
table:=""People"",
columns:={""First Name"", ""Last Name"", ""Geometry""},
values:=New Object() {""John"", Nothing, New String() {}})"
values:=New Object() {""John"", Nothing, System.Array.Empty(Of String)})"

Test(operation,
expectedCode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38495,7 +38495,7 @@ Namespace TestNamespace
}
principalBaseTvfFunction.Columns.Add("ValueTypeList", valueTypeListFunctionColumn)
relationalModel.Functions.Add(
("PrincipalBaseTvf", "dbo", New String() {}),
("PrincipalBaseTvf", "dbo", System.Array.Empty(Of String)),
principalBaseTvfFunction)
Dim principalBaseTvfFunctionMapping As New FunctionMapping(principalBase, principalBaseTvfFunction, principalBaseTvf, True)
principalBaseTvfFunction.AddTypeMapping(principalBaseTvfFunctionMapping, False)
Expand Down Expand Up @@ -44993,7 +44993,7 @@ Namespace TestNamespace
}
getAllDataFunction.Columns.Add("Blob", blobFunctionColumn)
relationalModel.Functions.Add(
("GetAllData", "dbo", New String() {}),
("GetAllData", "dbo", System.Array.Empty(Of String)),
getAllDataFunction)
Dim getAllDataFunctionMapping As New FunctionMapping(data, getAllDataFunction, getAllData, True)
getAllDataFunction.AddTypeMapping(getAllDataFunctionMapping, False)
Expand Down Expand Up @@ -45030,7 +45030,7 @@ Namespace TestNamespace
Dim getBlobs = DirectCast(Me.FindDbFunction("GetBlobs()"), IRuntimeDbFunction)
Dim getBlobsFunction As New StoreFunction(getBlobs, relationalModel)
relationalModel.Functions.Add(
("GetBlobs", "dbo", New String() {}),
("GetBlobs", "dbo", System.Array.Empty(Of String)),
getBlobsFunction)
Dim getBlobsFunctionMapping As New FunctionMapping([object], getBlobsFunction, getBlobs, True)
getBlobsFunction.AddTypeMapping(getBlobsFunctionMapping, False)
Expand Down

0 comments on commit 6c7cc26

Please # to comment.