Skip to content

Commit

Permalink
Remove redundant tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
MaRK0960 committed Jul 11, 2022
1 parent 3a7e6a5 commit 3f10651
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1481,20 +1481,12 @@ public virtual async Task Convert_ToString(bool async)

[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual async Task Byte_Parse(bool async)
{
await AssertQuery(
async,
ss => ss.Set<Order>().Where(o => o.CustomerID == "ALFKI" &&
byte.Parse(Convert.ToString(o.OrderID % 1)) >= 0),
entryCount: 6);

await AssertQuery(
public virtual Task Byte_Parse(bool async)
=> AssertQuery(
async,
ss => ss.Set<Customer>().Where(c => c.CustomerID == "ALFKI" &&
byte.Parse(c.Phone.Substring(0, 3)) == 30),
entryCount: 1);
}

[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
Expand Down Expand Up @@ -1536,12 +1528,6 @@ public virtual Task Byte_Parse_Decimal_Bad_Format(bool async)
[MemberData(nameof(IsAsyncData))]
public virtual async Task Decimal_Parse(bool async)
{
await AssertQuery(
async,
ss => ss.Set<Order>().Where(o => o.CustomerID == "ALFKI" &&
decimal.Parse(Convert.ToString(o.OrderID % 1)) >= 0),
entryCount: 6);

await AssertQuery(
async,
ss => ss.Set<Customer>().Where(c => c.CustomerID == "ALFKI" &&
Expand Down Expand Up @@ -1574,12 +1560,6 @@ public virtual Task Decimal_Parse_Non_Numeric_Bad_Format(bool async)
[MemberData(nameof(IsAsyncData))]
public virtual async Task Double_Parse(bool async)
{
await AssertQuery(
async,
ss => ss.Set<Order>().Where(o => o.CustomerID == "ALFKI" &&
double.Parse(Convert.ToString(o.OrderID % 1)) >= 0),
entryCount: 6);

await AssertQuery(
async,
ss => ss.Set<Customer>().Where(c => c.CustomerID == "ALFKI" &&
Expand Down Expand Up @@ -1612,12 +1592,6 @@ public virtual Task Double_Parse_Non_Numeric_Bad_Format(bool async)
[MemberData(nameof(IsAsyncData))]
public virtual async Task Short_Parse(bool async)
{
await AssertQuery(
async,
ss => ss.Set<Order>().Where(o => o.CustomerID == "ALFKI" &&
short.Parse(Convert.ToString(o.OrderID % 1)) >= 0),
entryCount: 6);

await AssertQuery(
async,
ss => ss.Set<Customer>().Where(c => c.CustomerID == "ALFKI" &&
Expand Down Expand Up @@ -1662,12 +1636,6 @@ public virtual Task Short_Parse_Decimal_Bad_Format(bool async)
[MemberData(nameof(IsAsyncData))]
public virtual async Task Int_Parse(bool async)
{
await AssertQuery(
async,
ss => ss.Set<Order>().Where(o => o.CustomerID == "ALFKI" &&
int.Parse(Convert.ToString(o.OrderID % 1)) >= 0),
entryCount: 6);

await AssertQuery(
async,
ss => ss.Set<Customer>().Where(c => c.CustomerID == "ALFKI" &&
Expand Down Expand Up @@ -1703,12 +1671,6 @@ public virtual Task Int_Parse_Decimal_Bad_Format(bool async)
[MemberData(nameof(IsAsyncData))]
public virtual async Task Long_Parse(bool async)
{
await AssertQuery(
async,
ss => ss.Set<Order>().Where(o => o.CustomerID == "ALFKI" &&
long.Parse(Convert.ToString(o.OrderID % 1)) >= 0),
entryCount: 6);

await AssertQuery(
async,
ss => ss.Set<Customer>().Where(c => c.CustomerID == "ALFKI" &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1624,10 +1624,6 @@ public override async Task Byte_Parse(bool async)
await base.Byte_Parse(async);

AssertSql(
@"SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate]
FROM [Orders] AS [o]
WHERE [o].[CustomerID] = N'ALFKI' AND CONVERT(tinyint, CONVERT(nvarchar(max), [o].[OrderID] % 1)) >= CAST(0 AS tinyint)",
//
@"SELECT [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region]
FROM [Customers] AS [c]
WHERE [c].[CustomerID] = N'ALFKI' AND CONVERT(tinyint, SUBSTRING([c].[Phone], 0 + 1, 3)) = CAST(30 AS tinyint)");
Expand Down Expand Up @@ -1670,10 +1666,6 @@ public override async Task Decimal_Parse(bool async)
await base.Decimal_Parse(async);

AssertSql(
@"SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate]
FROM [Orders] AS [o]
WHERE [o].[CustomerID] = N'ALFKI' AND CONVERT(decimal(18, 2), CONVERT(nvarchar(max), [o].[OrderID] % 1)) >= 0.0",
//
@"SELECT [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region]
FROM [Customers] AS [c]
WHERE [c].[CustomerID] = N'ALFKI' AND CONVERT(decimal(18, 2), [c].[PostalCode]) = 12209.0",
Expand All @@ -1700,10 +1692,6 @@ public override async Task Double_Parse(bool async)
await base.Double_Parse(async);

AssertSql(
@"SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate]
FROM [Orders] AS [o]
WHERE [o].[CustomerID] = N'ALFKI' AND CONVERT(float, CONVERT(nvarchar(max), [o].[OrderID] % 1)) >= 0.0E0",
//
@"SELECT [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region]
FROM [Customers] AS [c]
WHERE [c].[CustomerID] = N'ALFKI' AND CONVERT(float, [c].[PostalCode]) = 12209.0E0",
Expand All @@ -1730,10 +1718,6 @@ public override async Task Short_Parse(bool async)
await base.Short_Parse(async);

AssertSql(
@"SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate]
FROM [Orders] AS [o]
WHERE [o].[CustomerID] = N'ALFKI' AND CONVERT(smallint, CONVERT(nvarchar(max), [o].[OrderID] % 1)) >= CAST(0 AS smallint)",
//
@"SELECT [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region]
FROM [Customers] AS [c]
WHERE [c].[CustomerID] = N'ALFKI' AND CONVERT(smallint, [c].[PostalCode]) = CAST(12209 AS smallint)",
Expand Down Expand Up @@ -1772,10 +1756,6 @@ public override async Task Int_Parse(bool async)
await base.Int_Parse(async);

AssertSql(
@"SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate]
FROM [Orders] AS [o]
WHERE [o].[CustomerID] = N'ALFKI' AND CONVERT(int, CONVERT(nvarchar(max), [o].[OrderID] % 1)) >= 0",
//
@"SELECT [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region]
FROM [Customers] AS [c]
WHERE [c].[CustomerID] = N'ALFKI' AND CONVERT(int, [c].[PostalCode]) = 12209",
Expand Down Expand Up @@ -1806,10 +1786,6 @@ public override async Task Long_Parse(bool async)
await base.Long_Parse(async);

AssertSql(
@"SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate]
FROM [Orders] AS [o]
WHERE [o].[CustomerID] = N'ALFKI' AND CONVERT(bigint, CONVERT(nvarchar(max), [o].[OrderID] % 1)) >= CAST(0 AS bigint)",
//
@"SELECT [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region]
FROM [Customers] AS [c]
WHERE [c].[CustomerID] = N'ALFKI' AND CONVERT(bigint, [c].[PostalCode]) = CAST(12209 AS bigint)",
Expand Down

0 comments on commit 3f10651

Please sign in to comment.