Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ This test:
```cs
await Verify(connection);
```
<sup><a href='/src/Tests/Tests.cs#L77-L81' title='Snippet source file'>snippet source</a> | <a href='#snippet-SqlServerSchema' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Tests/Tests.cs#L81-L85' title='Snippet source file'>snippet source</a> | <a href='#snippet-SqlServerSchema' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

Will result in the following verified file:
Expand All @@ -69,7 +69,7 @@ await Verify(connection)
// include only tables and views
.SchemaIncludes(DbObjects.Tables | DbObjects.Views);
```
<sup><a href='/src/Tests/Tests.cs#L443-L449' title='Snippet source file'>snippet source</a> | <a href='#snippet-SchemaInclude' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Tests/Tests.cs#L447-L453' title='Snippet source file'>snippet source</a> | <a href='#snippet-SchemaInclude' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

Available values:
Expand Down Expand Up @@ -107,7 +107,7 @@ await Verify(connection)
_ => _ is TableViewBase ||
_.Name == "MyTrigger");
```
<sup><a href='/src/Tests/Tests.cs#L468-L476' title='Snippet source file'>snippet source</a> | <a href='#snippet-SchemaFilter' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Tests/Tests.cs#L472-L480' title='Snippet source file'>snippet source</a> | <a href='#snippet-SchemaFilter' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -129,7 +129,7 @@ command.CommandText = "select Value from MyTable";
var value = await command.ExecuteScalarAsync();
await Verify(value!);
```
<sup><a href='/src/Tests/Tests.cs#L252-L262' title='Snippet source file'>snippet source</a> | <a href='#snippet-Recording' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Tests/Tests.cs#L256-L266' title='Snippet source file'>snippet source</a> | <a href='#snippet-Recording' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

Will result in the following verified file:
Expand Down Expand Up @@ -184,7 +184,7 @@ await Verify(
sqlEntries = entries
});
```
<sup><a href='/src/Tests/Tests.cs#L329-L359' title='Snippet source file'>snippet source</a> | <a href='#snippet-RecordingSpecific' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Tests/Tests.cs#L333-L363' title='Snippet source file'>snippet source</a> | <a href='#snippet-RecordingSpecific' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand Down Expand Up @@ -212,7 +212,7 @@ var sqlErrorsViaType = entries
.Select(_ => _.Data)
.OfType<ErrorEntry>();
```
<sup><a href='/src/Tests/Tests.cs#L385-L404' title='Snippet source file'>snippet source</a> | <a href='#snippet-RecordingReadingResults' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Tests/Tests.cs#L389-L408' title='Snippet source file'>snippet source</a> | <a href='#snippet-RecordingReadingResults' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand Down
6 changes: 5 additions & 1 deletion src/Tests/Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ static Tests() =>
"VerifySqlServer",
connection =>
{
var server = new Server(new ServerConnection(connection));
var serverConnection = new ServerConnection
{
ConnectionString = connection.ConnectionString,
};
var server = new Server(serverConnection);
server.ConnectionContext.ExecuteNonQuery(
"""
CREATE TABLE
Expand Down
6 changes: 5 additions & 1 deletion src/Verify.SqlServer/SchemaValidation/SqlScriptBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ static SqlScriptBuilder()
public string BuildContent(SqlConnection connection)
{
var builder = new SqlConnectionStringBuilder(connection.ConnectionString);
var server = new Server(new ServerConnection(connection));
var serverConnection = new ServerConnection
{
ConnectionString = connection.ConnectionString,
};
var server = new Server(serverConnection);

return BuildContent(server, builder);
}
Expand Down
Loading