Skip to content

Commit

Permalink
cleanup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pwelter34 committed May 3, 2024
1 parent 3ee1f18 commit db1aa0f
Show file tree
Hide file tree
Showing 51 changed files with 73 additions and 271 deletions.
1 change: 1 addition & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Restore Dependencies
run: dotnet restore
Expand Down
5 changes: 4 additions & 1 deletion FluentCommand.sln
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FluentCommand", "src\FluentCommand\FluentCommand.csproj", "{4D5F125D-8DD5-496B-959E-78F55D8BE946}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{228D7B65-A886-4D86-AED0-F3CB0C61819B}"
ProjectSection(SolutionItems) = preProject
test\Directory.Build.props = test\Directory.Build.props
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FluentCommand.Entities", "test\FluentCommand.Entities\FluentCommand.Entities.csproj", "{A1DC06EF-CBFB-4EE7-883D-4BF0369F2654}"
EndProject
Expand Down Expand Up @@ -37,7 +40,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FluentCommand.Performance",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FluentCommand.Caching", "src\FluentCommand.Caching\FluentCommand.Caching.csproj", "{4565EA0D-C7E4-4327-B78D-C5B19C76AC8A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentCommand.Csv", "src\FluentCommand.Csv\FluentCommand.Csv.csproj", "{FE8CBF1C-7231-4D26-A2DB-EDB0E7F29871}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FluentCommand.Csv", "src\FluentCommand.Csv\FluentCommand.Csv.csproj", "{FE8CBF1C-7231-4D26-A2DB-EDB0E7F29871}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
2 changes: 1 addition & 1 deletion src/FluentCommand.Csv/FluentCommand.Csv.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CsvHelper" Version="32.0.0" />
<PackageReference Include="CsvHelper" Version="32.0.1" />
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.0" />
</ItemGroup>

Expand Down
46 changes: 46 additions & 0 deletions test/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<Project>

<PropertyGroup Label="Package">
<Copyright>Copyright © $([System.DateTime]::Now.ToString(yyyy)) LoreSoft</Copyright>
<Authors>LoreSoft</Authors>
<NeutralLanguage>en-US</NeutralLanguage>
<IsPackable>false</IsPackable>
</PropertyGroup>

<PropertyGroup Label="Debug">
<DebugType>embedded</DebugType>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>false</IncludeSymbols>
</PropertyGroup>

<PropertyGroup Label="Options">
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<NoWarn>1591</NoWarn>
</PropertyGroup>

<PropertyGroup>
<MinVerTagPrefix>v</MinVerTagPrefix>
</PropertyGroup>

<ItemGroup>
<Compile Remove="TestResults\**" />
<EmbeddedResource Remove="TestResults\**" />
<None Remove="TestResults\**" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="AssemblyMetadata.Generators" Version="2.0.0" PrivateAssets="All" />
<PackageReference Include="Bogus" Version="35.5.0" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="MinVer" Version="5.0.0" PrivateAssets="All" />
<PackageReference Include="XUnit.Hosting" Version="1.5.0" />
</ItemGroup>

<ItemGroup>
<Using Include="FluentAssertions" />
<Using Include="Xunit" />
<Using Include="Xunit.Abstractions" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="Verify.Xunit" Version="24.1.0" />
<PackageReference Include="xunit" Version="2.7.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.8">
<PackageReference Include="xunit" Version="2.8.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
1 change: 0 additions & 1 deletion test/FluentCommand.Generators.Tests/Usings.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;

using FluentAssertions;

using FluentCommand.Entities;
using FluentCommand.Extensions;

using Microsoft.Extensions.DependencyInjection;

using Xunit;
using Xunit.Abstractions;

namespace FluentCommand.PostgreSQL.Tests;

public class DataCommandSqlAsyncTests : DatabaseTestBase
Expand Down
9 changes: 0 additions & 9 deletions test/FluentCommand.PostgreSQL.Tests/DataCommandSqlTests.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;

using FluentAssertions;

using FluentCommand.Entities;
using FluentCommand.Extensions;

using Microsoft.Extensions.DependencyInjection;

using Xunit;
using Xunit.Abstractions;

namespace FluentCommand.PostgreSQL.Tests;

public class DataCommandSqlTests : DatabaseTestBase
Expand Down
8 changes: 0 additions & 8 deletions test/FluentCommand.PostgreSQL.Tests/DataQueryTests.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
using System;
using System.Linq;

using FluentAssertions;

using FluentCommand;
using FluentCommand.Entities;
using FluentCommand.Extensions;
using FluentCommand.Query;

using Microsoft.Extensions.DependencyInjection;

using Xunit;
using Xunit.Abstractions;

namespace FluentCommand.PostgreSQL.Tests;

public class DataQueryTests : DatabaseTestBase
Expand Down
4 changes: 0 additions & 4 deletions test/FluentCommand.PostgreSQL.Tests/DatabaseCollection.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
using System;

using Xunit;

namespace FluentCommand.PostgreSQL.Tests;

[CollectionDefinition(DatabaseCollection.CollectionName)]
Expand Down
5 changes: 0 additions & 5 deletions test/FluentCommand.PostgreSQL.Tests/DatabaseFixture.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
using System.Threading.Tasks;

using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;

using Npgsql;

using Testcontainers.PostgreSql;

using Xunit;

using XUnit.Hosting;

namespace FluentCommand.PostgreSQL.Tests;
Expand Down
3 changes: 0 additions & 3 deletions test/FluentCommand.PostgreSQL.Tests/DatabaseInitializer.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;

using DbUp;
using DbUp.Engine.Output;

using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;

Expand Down
3 changes: 0 additions & 3 deletions test/FluentCommand.PostgreSQL.Tests/DatabaseTestBase.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using Xunit;
using Xunit.Abstractions;

using XUnit.Hosting;

namespace FluentCommand.PostgreSQL.Tests;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Bogus" Version="35.5.0" />
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand All @@ -31,17 +30,14 @@
<PackageReference Include="Npgsql" Version="8.0.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="Testcontainers.Postgresql" Version="3.8.0" />
<PackageReference Include="XUnit.Hosting" Version="1.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.8">
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.7.1" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="xunit" Version="2.8.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\FluentCommand.Caching\FluentCommand.Caching.csproj" />
<ProjectReference Include="..\..\src\FluentCommand\FluentCommand.csproj" />
<ProjectReference Include="..\FluentCommand.Entities\FluentCommand.Entities.csproj" />
</ItemGroup>
Expand Down
9 changes: 0 additions & 9 deletions test/FluentCommand.SQLite.Tests/DataCommandSqlAsyncTests.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;

using FluentAssertions;

using FluentCommand.Entities;
using FluentCommand.Extensions;

using Microsoft.Extensions.DependencyInjection;

using Xunit;
using Xunit.Abstractions;

namespace FluentCommand.SQLite.Tests;

public class DataCommandSqlAsyncTests : DatabaseTestBase
Expand Down
9 changes: 0 additions & 9 deletions test/FluentCommand.SQLite.Tests/DataCommandSqlTests.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;

using FluentAssertions;

using FluentCommand.Entities;
using FluentCommand.Extensions;

using Microsoft.Extensions.DependencyInjection;

using Xunit;
using Xunit.Abstractions;

namespace FluentCommand.SQLite.Tests;

public class DataCommandSqlTests : DatabaseTestBase
Expand Down
8 changes: 0 additions & 8 deletions test/FluentCommand.SQLite.Tests/DataQueryTests.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
using System;
using System.Linq;

using FluentAssertions;

using FluentCommand;
using FluentCommand.Entities;
using FluentCommand.Extensions;
using FluentCommand.Query;

using Microsoft.Extensions.DependencyInjection;

using Xunit;
using Xunit.Abstractions;

namespace FluentCommand.SQLite.Tests;

public class DataQueryTests : DatabaseTestBase
Expand Down
4 changes: 0 additions & 4 deletions test/FluentCommand.SQLite.Tests/DatabaseCollection.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
using System;

using Xunit;

[assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly, DisableTestParallelization = true)]

namespace FluentCommand.SQLite.Tests;
Expand Down
13 changes: 5 additions & 8 deletions test/FluentCommand.SQLite.Tests/DatabaseFixture.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
using Microsoft.Data.Sqlite;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;

using XUnit.Hosting;

namespace FluentCommand.SQLite.Tests;

public class DatabaseFixture : TestHostFixture
public class DatabaseFixture : TestApplicationFixture
{
protected override void ConfigureLogging(HostBuilderContext context, ILoggingBuilder builder)
protected override void ConfigureApplication(HostApplicationBuilder builder)
{
base.ConfigureLogging(context, builder);
builder.SetMinimumLevel(LogLevel.Debug);
}
base.ConfigureApplication(builder);

var services = builder.Services;

protected override void ConfigureServices(HostBuilderContext context, IServiceCollection services)
{
services.AddHostedService<DatabaseInitializer>();

services.AddFluentCommand(builder => builder
Expand Down
2 changes: 0 additions & 2 deletions test/FluentCommand.SQLite.Tests/DatabaseInitializer.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;

using DbUp;
using DbUp.Engine.Output;
Expand Down
3 changes: 0 additions & 3 deletions test/FluentCommand.SQLite.Tests/DatabaseTestBase.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using Xunit;
using Xunit.Abstractions;

using XUnit.Hosting;

namespace FluentCommand.SQLite.Tests;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,18 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Bogus" Version="35.5.0" />
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="dbup-sqlite" Version="5.0.40" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="8.0.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="XUnit.Hosting" Version="1.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.8">
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.7.1" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="xunit" Version="2.8.0" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 0 additions & 8 deletions test/FluentCommand.SqlServer.Tests/CsvTests.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
using System;
using System.Net.Mime;

using Azure.Storage.Blobs;
using Azure.Storage.Blobs.Models;

using FluentAssertions;

using FluentCommand.Entities;
using FluentCommand.Query;

using Microsoft.Extensions.DependencyInjection;

using Xunit;
using Xunit.Abstractions;

using Task = System.Threading.Tasks.Task;

namespace FluentCommand.SqlServer.Tests;
Expand Down
7 changes: 0 additions & 7 deletions test/FluentCommand.SqlServer.Tests/DataBulkCopyTests.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
using System;

using Bogus;

using FluentAssertions;

using FluentCommand.Bulk;
using FluentCommand.Entities;

using Microsoft.Extensions.DependencyInjection;

using Xunit;
using Xunit.Abstractions;

namespace FluentCommand.SqlServer.Tests;

public class DataBulkCopyTests : DatabaseTestBase
Expand Down
Loading

0 comments on commit db1aa0f

Please sign in to comment.