Skip to content

Commit

Permalink
QueryCompilerTests are actually QueryComponentTests
Browse files Browse the repository at this point in the history
  • Loading branch information
weelink committed Jun 26, 2019
1 parent 923b23b commit d6b16a6
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 49 deletions.
49 changes: 0 additions & 49 deletions src/FluentSQL.Tests/Compilation/QueryCompilerTests.cs

This file was deleted.

45 changes: 45 additions & 0 deletions src/FluentSQL.Tests/Querying/QueryComponentTests.cs
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; }
}
}
}

0 comments on commit d6b16a6

Please sign in to comment.