Skip to content

Commit

Permalink
Update SQL baselines
Browse files Browse the repository at this point in the history
Part of #17337
  • Loading branch information
smitpatel committed Mar 22, 2021
1 parent 1d2cd44 commit 203f408
Show file tree
Hide file tree
Showing 24 changed files with 1,385 additions and 1,297 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,26 +74,26 @@ public override async Task Load_collection_using_Query_with_Include_for_same_col
AssertSql(
@"@__p_0='3'
SELECT [t].[Id], [t].[CollectionInverseId], [t].[Name], [t].[ReferenceInverseId], [e].[Id], [t].[EntityOneId], [t].[EntityTwoId], [t1].[EntityOneId], [t1].[EntityTwoId], [t1].[Id], [t1].[Name], [t1].[EntityOneId0], [t1].[EntityTwoId0], [t1].[Id0], [t1].[CollectionInverseId], [t1].[Name0], [t1].[ReferenceInverseId]
SELECT [t].[Id], [t].[CollectionInverseId], [t].[Name], [t].[ReferenceInverseId], [e].[Id], [t].[EntityOneId], [t].[EntityTwoId], [t0].[EntityOneId], [t0].[EntityTwoId], [t0].[Id], [t0].[Name], [t0].[EntityOneId0], [t0].[EntityTwoId0], [t0].[Id0], [t0].[CollectionInverseId], [t0].[Name0], [t0].[ReferenceInverseId]
FROM [EntityOnes] AS [e]
INNER JOIN (
SELECT [e1].[Id], [e1].[CollectionInverseId], [e1].[Name], [e1].[ReferenceInverseId], [e0].[EntityOneId], [e0].[EntityTwoId]
FROM [EntityOneEntityTwo] AS [e0]
INNER JOIN [EntityTwos] AS [e1] ON [e0].[EntityTwoId] = [e1].[Id]
) AS [t] ON [e].[Id] = [t].[EntityOneId]
LEFT JOIN (
SELECT [e2].[EntityOneId], [e2].[EntityTwoId], [e3].[Id], [e3].[Name], [t0].[EntityOneId] AS [EntityOneId0], [t0].[EntityTwoId] AS [EntityTwoId0], [t0].[Id] AS [Id0], [t0].[CollectionInverseId], [t0].[Name] AS [Name0], [t0].[ReferenceInverseId]
SELECT [e2].[EntityOneId], [e2].[EntityTwoId], [e3].[Id], [e3].[Name], [t1].[EntityOneId] AS [EntityOneId0], [t1].[EntityTwoId] AS [EntityTwoId0], [t1].[Id] AS [Id0], [t1].[CollectionInverseId], [t1].[Name] AS [Name0], [t1].[ReferenceInverseId]
FROM [EntityOneEntityTwo] AS [e2]
INNER JOIN [EntityOnes] AS [e3] ON [e2].[EntityOneId] = [e3].[Id]
LEFT JOIN (
SELECT [e4].[EntityOneId], [e4].[EntityTwoId], [e5].[Id], [e5].[CollectionInverseId], [e5].[Name], [e5].[ReferenceInverseId]
FROM [EntityOneEntityTwo] AS [e4]
INNER JOIN [EntityTwos] AS [e5] ON [e4].[EntityTwoId] = [e5].[Id]
) AS [t0] ON [e3].[Id] = [t0].[EntityOneId]
) AS [t1] ON [e3].[Id] = [t1].[EntityOneId]
WHERE [e3].[Id] = @__p_0
) AS [t1] ON [t].[Id] = [t1].[EntityTwoId]
) AS [t0] ON [t].[Id] = [t0].[EntityTwoId]
WHERE [e].[Id] = @__p_0
ORDER BY [e].[Id], [t].[EntityOneId], [t].[EntityTwoId], [t].[Id], [t1].[EntityOneId], [t1].[EntityTwoId], [t1].[Id], [t1].[EntityOneId0], [t1].[EntityTwoId0], [t1].[Id0]");
ORDER BY [e].[Id], [t].[EntityOneId], [t].[EntityTwoId], [t].[Id], [t0].[EntityOneId], [t0].[EntityTwoId], [t0].[Id], [t0].[EntityOneId0], [t0].[EntityTwoId0], [t0].[Id0]");
}

public override async Task Load_collection_using_Query_with_Include(bool async)
Expand Down Expand Up @@ -164,20 +164,20 @@ public override async Task Load_collection_using_Query_with_filtered_Include_and
SELECT [t].[Id], [t].[Name], (
SELECT COUNT(*)
FROM [EntityOneEntityTwo] AS [e]
INNER JOIN [EntityOnes] AS [e0] ON [e].[EntityOneId] = [e0].[Id]
WHERE [t].[Id] = [e].[EntityTwoId]) AS [Count1], (
FROM [EntityOneEntityTwo] AS [e2]
INNER JOIN [EntityOnes] AS [e3] ON [e2].[EntityOneId] = [e3].[Id]
WHERE [t].[Id] = [e2].[EntityTwoId]) AS [Count1], (
SELECT COUNT(*)
FROM [JoinTwoToThree] AS [j]
INNER JOIN [EntityThrees] AS [e1] ON [j].[ThreeId] = [e1].[Id]
INNER JOIN [EntityThrees] AS [e4] ON [j].[ThreeId] = [e4].[Id]
WHERE [t].[Id] = [j].[TwoId]) AS [Count3]
FROM [EntityOnes] AS [e2]
FROM [EntityOnes] AS [e]
INNER JOIN (
SELECT [e4].[Id], [e4].[Name], [e3].[EntityOneId]
FROM [EntityOneEntityTwo] AS [e3]
INNER JOIN [EntityTwos] AS [e4] ON [e3].[EntityTwoId] = [e4].[Id]
) AS [t] ON [e2].[Id] = [t].[EntityOneId]
WHERE [e2].[Id] = @__p_0
SELECT [e1].[Id], [e1].[Name], [e0].[EntityOneId]
FROM [EntityOneEntityTwo] AS [e0]
INNER JOIN [EntityTwos] AS [e1] ON [e0].[EntityTwoId] = [e1].[Id]
) AS [t] ON [e].[Id] = [t].[EntityOneId]
WHERE [e].[Id] = @__p_0
ORDER BY [t].[Id]");
}

Expand All @@ -188,30 +188,30 @@ public override async Task Load_collection_using_Query_with_join(bool async)
AssertSql(
@"@__p_0='3'
SELECT [t].[Id], [t].[CollectionInverseId], [t].[Name], [t].[ReferenceInverseId], [t1].[Id0], [t1].[CollectionInverseId], [t1].[Name0], [t1].[ReferenceInverseId], [e].[Id], [t].[EntityOneId], [t].[EntityTwoId], [t1].[Id], [t1].[EntityOneId], [t1].[EntityTwoId], [t2].[EntityOneId], [t2].[EntityTwoId], [t2].[Id], [t2].[Name]
SELECT [t].[Id], [t].[CollectionInverseId], [t].[Name], [t].[ReferenceInverseId], [t0].[Id0], [t0].[CollectionInverseId], [t0].[Name0], [t0].[ReferenceInverseId], [e].[Id], [t].[EntityOneId], [t].[EntityTwoId], [t0].[Id], [t0].[EntityOneId], [t0].[EntityTwoId], [t2].[EntityOneId], [t2].[EntityTwoId], [t2].[Id], [t2].[Name]
FROM [EntityOnes] AS [e]
INNER JOIN (
SELECT [e1].[Id], [e1].[CollectionInverseId], [e1].[Name], [e1].[ReferenceInverseId], [e0].[EntityOneId], [e0].[EntityTwoId]
FROM [EntityOneEntityTwo] AS [e0]
INNER JOIN [EntityTwos] AS [e1] ON [e0].[EntityTwoId] = [e1].[Id]
) AS [t] ON [e].[Id] = [t].[EntityOneId]
INNER JOIN (
SELECT [e2].[Id], [t0].[Id] AS [Id0], [t0].[CollectionInverseId], [t0].[Name] AS [Name0], [t0].[ReferenceInverseId], [t0].[EntityOneId], [t0].[EntityTwoId]
SELECT [e2].[Id], [t1].[Id] AS [Id0], [t1].[CollectionInverseId], [t1].[Name] AS [Name0], [t1].[ReferenceInverseId], [t1].[EntityOneId], [t1].[EntityTwoId]
FROM [EntityOnes] AS [e2]
INNER JOIN (
SELECT [e4].[Id], [e4].[CollectionInverseId], [e4].[Name], [e4].[ReferenceInverseId], [e3].[EntityOneId], [e3].[EntityTwoId]
FROM [EntityOneEntityTwo] AS [e3]
INNER JOIN [EntityTwos] AS [e4] ON [e3].[EntityTwoId] = [e4].[Id]
) AS [t0] ON [e2].[Id] = [t0].[EntityOneId]
) AS [t1] ON [t].[Id] = [t1].[Id0]
) AS [t1] ON [e2].[Id] = [t1].[EntityOneId]
) AS [t0] ON [t].[Id] = [t0].[Id0]
LEFT JOIN (
SELECT [e5].[EntityOneId], [e5].[EntityTwoId], [e6].[Id], [e6].[Name]
FROM [EntityOneEntityTwo] AS [e5]
INNER JOIN [EntityOnes] AS [e6] ON [e5].[EntityOneId] = [e6].[Id]
WHERE [e6].[Id] = @__p_0
) AS [t2] ON [t].[Id] = [t2].[EntityTwoId]
WHERE [e].[Id] = @__p_0
ORDER BY [e].[Id], [t].[EntityOneId], [t].[EntityTwoId], [t].[Id], [t1].[Id], [t1].[EntityOneId], [t1].[EntityTwoId], [t1].[Id0], [t2].[EntityOneId], [t2].[EntityTwoId], [t2].[Id]");
ORDER BY [e].[Id], [t].[EntityOneId], [t].[EntityTwoId], [t].[Id], [t0].[Id], [t0].[EntityOneId], [t0].[EntityTwoId], [t0].[Id0], [t2].[EntityOneId], [t2].[EntityTwoId], [t2].[Id]");
}

protected override void ClearLog()
Expand All @@ -238,9 +238,11 @@ private void AssertSql(string expected)
new[] { Environment.NewLine },
StringSplitOptions.RemoveEmptyEntries)[2].Substring(6);

var testName = methodCallLine.Substring(0, methodCallLine.IndexOf(')') + 1);
var lineIndex = methodCallLine.LastIndexOf("line", StringComparison.Ordinal);
var lineNumber = lineIndex > 0 ? methodCallLine.Substring(lineIndex) : "";
var indexMethodEnding = methodCallLine.IndexOf(')') + 1;
var testName = methodCallLine.Substring(0, indexMethodEnding);
var parts = methodCallLine[indexMethodEnding..].Split(" ", StringSplitOptions.RemoveEmptyEntries);
var fileName = parts[1][..^5];
var lineNumber = int.Parse(parts[2]);

var currentDirectory = Directory.GetCurrentDirectory();
var logFile = currentDirectory.Substring(
Expand All @@ -255,7 +257,7 @@ private void AssertSql(string expected)
";

var contents = testInfo + newBaseLine + FileNewLine + FileNewLine;
var contents = testInfo + newBaseLine + FileNewLine + "--------------------" + FileNewLine;

File.AppendAllText(logFile, contents);

Expand Down
Loading

0 comments on commit 203f408

Please sign in to comment.