-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
QueryCompilerTests are actually QueryComponentTests
- Loading branch information
Showing
2 changed files
with
45 additions
and
49 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using FluentAssertions; | ||
|
||
using FluentSQL.Databases; | ||
using FluentSQL.Querying; | ||
using FluentSQL.Querying.Extensions; | ||
using FluentSQL.Querying.Statements.Extensions; | ||
using FluentSQL.Tests.Databases.Builders; | ||
using FluentSQL.Tests.Examples; | ||
|
||
using Xunit; | ||
|
||
namespace FluentSQL.Tests.Querying | ||
{ | ||
public class QueryComponentTests | ||
{ | ||
public class When_compiling_a_query : Specification<QueryComponent<NoParameters, string>> | ||
{ | ||
protected override QueryComponent<NoParameters, string> EstablishContext() | ||
{ | ||
Database database = new DatabaseBuilder().Build(); | ||
|
||
var model = new ExampleModel(database); | ||
QueryComponent<NoParameters, string> queryComponent = | ||
model.Query<string>() | ||
.From(() => model.Customers) | ||
.Select(() => model.Customers.Name); | ||
|
||
return queryComponent; | ||
} | ||
|
||
protected override void Because(QueryComponent<NoParameters, string> sut) | ||
{ | ||
Query = sut.Compile(); | ||
} | ||
|
||
[Fact] | ||
public void It_should_create_the_query() | ||
{ | ||
Query.Should().NotBeNull(); | ||
} | ||
|
||
private Query<string> Query { get; set; } | ||
} | ||
} | ||
} |