Skip to content

Commit

Permalink
fix test snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
pwelter34 committed May 6, 2024
1 parent ec3c6b6 commit 7686bcf
Show file tree
Hide file tree
Showing 16 changed files with 81 additions and 38 deletions.
10 changes: 8 additions & 2 deletions test/FluentCommand.Tests/Query/DeleteBuilderTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ public async System.Threading.Tasks.Task DeleteEntityWithComment()

var sql = queryStatement.Statement;

await Verifier.Verify(sql).UseDirectory("Snapshots");
await Verifier
.Verify(sql)
.UseDirectory("Snapshots")
.ScrubLinesContaining("/* Caller;");
}

[Fact]
Expand All @@ -61,7 +64,10 @@ public async System.Threading.Tasks.Task DeleteEntityJoin()

var sql = queryStatement.Statement;

await Verifier.Verify(sql).UseDirectory("Snapshots");
await Verifier
.Verify(sql)
.UseDirectory("Snapshots")
.ScrubLinesContaining("/* Caller;");
}

}
5 changes: 4 additions & 1 deletion test/FluentCommand.Tests/Query/InsertBuilderTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ public async System.Threading.Tasks.Task InsertEntityValueWithOutput()

var sql = queryStatement.Statement;

await Verifier.Verify(sql).UseDirectory("Snapshots");
await Verifier
.Verify(sql)
.UseDirectory("Snapshots")
.ScrubLinesContaining("/* Caller;");
}
}
5 changes: 4 additions & 1 deletion test/FluentCommand.Tests/Query/QueryBuilderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ public async System.Threading.Tasks.Task QueryBuilderSelect()

var sql = queryStatement.Statement;

await Verifier.Verify(sql).UseDirectory("Snapshots");
await Verifier
.Verify(sql)
.UseDirectory("Snapshots")
.ScrubLinesContaining("/* Caller;");
}
}

59 changes: 47 additions & 12 deletions test/FluentCommand.Tests/Query/SelectBuilderTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ public async System.Threading.Tasks.Task SelectEntityNestedWhereBuilder()

var sql = queryStatement.Statement;

await Verifier.Verify(sql).UseDirectory("Snapshots");
await Verifier
.Verify(sql)
.UseDirectory("Snapshots")
.ScrubLinesContaining("/* Caller;");
}

[Fact]
Expand All @@ -58,7 +61,9 @@ public async System.Threading.Tasks.Task SelectEntityWhereTagBuilder()

var sql = queryStatement.Statement;

await Verifier.Verify(sql).UseDirectory("Snapshots");
await Verifier
.Verify(sql)
.UseDirectory("Snapshots");
}

[Fact]
Expand All @@ -82,7 +87,10 @@ public async System.Threading.Tasks.Task SelectEntityWhereLimitBuilder()

var sql = queryStatement.Statement;

await Verifier.Verify(sql).UseDirectory("Snapshots");
await Verifier
.Verify(sql)
.UseDirectory("Snapshots")
.ScrubLinesContaining("/* Caller;");
}

[Fact]
Expand All @@ -103,7 +111,10 @@ public async System.Threading.Tasks.Task SelectEntityAliasWhereTagBuilder()

var sql = queryStatement.Statement;

await Verifier.Verify(sql).UseDirectory("Snapshots");
await Verifier
.Verify(sql)
.UseDirectory("Snapshots")
.ScrubLinesContaining("/* Caller;");
}

[Fact]
Expand All @@ -123,7 +134,10 @@ public async System.Threading.Tasks.Task SelectColumnsAliasWhereTagBuilder()

var sql = queryStatement.Statement;

await Verifier.Verify(sql).UseDirectory("Snapshots");
await Verifier
.Verify(sql)
.UseDirectory("Snapshots")
.ScrubLinesContaining("/* Caller;");
}

[Fact]
Expand All @@ -144,7 +158,10 @@ public async System.Threading.Tasks.Task SelectEntityTemporalBuilder()

var sql = queryStatement.Statement;

await Verifier.Verify(sql).UseDirectory("Snapshots");
await Verifier
.Verify(sql)
.UseDirectory("Snapshots")
.ScrubLinesContaining("/* Caller;");
}

[Fact]
Expand All @@ -168,7 +185,10 @@ public async System.Threading.Tasks.Task SelectEntityChangeTableBuilder()

var sql = queryStatement.Statement;

await Verifier.Verify(sql).UseDirectory("Snapshots");
await Verifier
.Verify(sql)
.UseDirectory("Snapshots")
.ScrubLinesContaining("/* Caller;");
}

[Fact]
Expand All @@ -188,7 +208,10 @@ public async System.Threading.Tasks.Task SelectEntityWhereIn()

var sql = queryStatement.Statement;

await Verifier.Verify(sql).UseDirectory("Snapshots");
await Verifier
.Verify(sql)
.UseDirectory("Snapshots")
.ScrubLinesContaining("/* Caller;");
}
[Fact]
public async System.Threading.Tasks.Task SelectEntityWhereInDouble()
Expand All @@ -208,7 +231,10 @@ public async System.Threading.Tasks.Task SelectEntityWhereInDouble()

var sql = queryStatement.Statement;

await Verifier.Verify(sql).UseDirectory("Snapshots");
await Verifier
.Verify(sql)
.UseDirectory("Snapshots")
.ScrubLinesContaining("/* Caller;");
}
[Fact]
public async System.Threading.Tasks.Task SelectEntityWhereInIf()
Expand All @@ -227,7 +253,10 @@ public async System.Threading.Tasks.Task SelectEntityWhereInIf()

var sql = queryStatement.Statement;

await Verifier.Verify(sql).UseDirectory("Snapshots");
await Verifier
.Verify(sql)
.UseDirectory("Snapshots")
.ScrubLinesContaining("/* Caller;");
}

[Fact]
Expand Down Expand Up @@ -262,7 +291,10 @@ public async System.Threading.Tasks.Task SelectEntityJoinBuilder()

var sql = queryStatement.Statement;

await Verifier.Verify(sql).UseDirectory("Snapshots");
await Verifier
.Verify(sql)
.UseDirectory("Snapshots")
.ScrubLinesContaining("/* Caller;");
}

[Fact]
Expand All @@ -278,7 +310,10 @@ public async System.Threading.Tasks.Task SelectEntityFilterBuilder()

var sql = queryStatement.Statement;

await Verifier.Verify(sql).UseDirectory("Snapshots");
await Verifier
.Verify(sql)
.UseDirectory("Snapshots")
.ScrubLinesContaining("/* Caller;");
}
private class EntityAlias
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* Caller; DeleteEntityJoin() in DeleteBuilderTest.cs:line 57 */
DELETE FROM [Task]
DELETE FROM [Task]
OUTPUT [DELETED].[Id]
FROM [Task] AS [t]
INNER JOIN [Priority] AS [p] ON [t].[PriorityId] = [p].[Id]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* Caller; DeleteEntityWithComment() in DeleteBuilderTest.cs:line 39 */
DELETE FROM [dbo].[Status]
DELETE FROM [dbo].[Status]
OUTPUT [DELETED].[Id]
WHERE ([Id] = @p0000);
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* Caller; SelectColumnsAliasWhereTagBuilder() in SelectBuilderTest.cs:line 122 */
SELECT [EntityId] AS [Id], [Name]
SELECT [EntityId] AS [Id], [Name]
FROM [EntityAlias]
WHERE ([EntityId] = @p0000)
ORDER BY [Name] ASC;
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* Caller; SelectEntityAliasWhereTagBuilder() in SelectBuilderTest.cs:line 101 */
SELECT [EntityId] AS [Id], [Name]
SELECT [EntityId] AS [Id], [Name]
FROM [EntityAlias]
WHERE ([EntityId] = @p0000)
ORDER BY [Name] ASC;
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* Caller; SelectEntityJoinBuilder() in SelectBuilderTest.cs:line 246 */
SELECT [t].[Id], [t].[Description], [t].[DueDate], [u].[DisplayName], [u].[EmailAddress] AS [Email], [s].[Name] AS [Status]
FROM [Task] AS [t]
INNER JOIN [dbo].[Status] AS [s] ON [t].[StatusId] = [s].[Id]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* Caller; SelectEntityTemporalBuilder() in SelectBuilderTest.cs:line 142 */
SELECT [Id], [Name]
SELECT [Id], [Name]
FROM [dbo].[Status] FOR SYSTEM_TIME AS OF @p0000
WHERE ([Id] = @p0001)
ORDER BY [Name] ASC;
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* Caller; SelectEntityWhereIn() in SelectBuilderTest.cs:line 187 */
SELECT [Id], [Name]
SELECT [Id], [Name]
FROM [dbo].[Status]
WHERE ([Id] IN (@p0000,@p0001))
ORDER BY [Name] ASC;
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* Caller; SelectEntityWhereInDouble() in SelectBuilderTest.cs:line 206 */
SELECT [Id], [Name]
SELECT [Id], [Name]
FROM [dbo].[Status]
WHERE ([Id] IN (@p0000,@p0001) AND [Name] IN (@p0002,@p0003))
ORDER BY [Name] ASC;
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* Caller; SelectEntityWhereInIf() in SelectBuilderTest.cs:line 226 */
SELECT [Id], [Name]
SELECT [Id], [Name]
FROM [dbo].[Status]
WHERE ([Id] IN (@p0000,@p0001))
ORDER BY [Name] ASC;
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* Caller; SelectEntityWhereLimitBuilder() in SelectBuilderTest.cs:line 77 */
SELECT [Id], [Name], [Description]
SELECT [Id], [Name], [Description]
FROM [dbo].[Status]
WHERE ([IsActive] = @p0000)
ORDER BY [DisplayOrder] DESC, [Name] ASC
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Select Entity Where Tag Builder Query; SelectEntityWhereTagBuilder() in SelectBuilderTest.cs:line 54 */
/* Select Entity Where Tag Builder Query; SelectEntityWhereTagBuilder() in SelectBuilderTest.cs:line 51 */
SELECT [Id], [Name], [Description]
FROM [dbo].[Status]
WHERE ([IsActive] = @p0000)
Expand Down
10 changes: 8 additions & 2 deletions test/FluentCommand.Tests/Query/UpdateBuilderTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ public async System.Threading.Tasks.Task UpdateEntityValueWithOutput()

var sql = queryStatement.Statement;

await Verifier.Verify(sql).UseDirectory("Snapshots");
await Verifier
.Verify(sql)
.UseDirectory("Snapshots")
.ScrubLinesContaining("/* Caller;");
}

[Fact]
Expand All @@ -49,6 +52,9 @@ public async System.Threading.Tasks.Task UpdateEntityValueWithJoin()

var sql = queryStatement.Statement;

await Verifier.Verify(sql).UseDirectory("Snapshots");
await Verifier
.Verify(sql)
.UseDirectory("Snapshots")
.ScrubLinesContaining("/* Caller;");
}
}

0 comments on commit 7686bcf

Please sign in to comment.