Skip to content

Commit 0d6f218

Browse files
committed
Add tests to bring coverage up
It';'s quiet possible that the tests exist in the original project(s) but...
1 parent c2f97fa commit 0d6f218

File tree

35 files changed

+494
-141
lines changed

35 files changed

+494
-141
lines changed

DatabaseTesting.sln

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AStar.Dev.Technical.Debt.Re
77
EndProject
88
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AStar.Dev.Utilities", "support\AStar.Dev.Utilities\AStar.Dev.Utilities.csproj", "{28720605-9CA9-4A33-BB00-655F4B76CA19}"
99
EndProject
10-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AStar.Dev.Infrastructure.FilesDb.Tests.Integration", "test\AStar.Dev.Infrastructure.FilesDb.Tests.Unit\AStar.Dev.Infrastructure.FilesDb.Tests.Integration.csproj", "{2860766A-6251-4874-9535-199ED5E29AA0}"
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AStar.Dev.Infrastructure.FilesDb.Tests.Integration", "test\AStar.Dev.Infrastructure.FilesDb.Tests.Integration\AStar.Dev.Infrastructure.FilesDb.Tests.Integration.csproj", "{2860766A-6251-4874-9535-199ED5E29AA0}"
1111
EndProject
1212
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbContextHelpers", "support\DbContextHelpers\DbContextHelpers.csproj", "{FE38F9CD-8573-44D1-A03F-73D318B6E86D}"
1313
EndProject
@@ -36,6 +36,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AStar.Dev.Infrastructure",
3636
EndProject
3737
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AStar.Dev.Infrastructure.FilesDb", "src\AStar.Dev.Infrastructure.FilesDb\AStar.Dev.Infrastructure.FilesDb.csproj", "{626B3E85-6C5D-4D8B-96BB-BF2D375326CA}"
3838
EndProject
39+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AStar.Dev.Infrastructure.Tests.Unit", "test\AStar.Dev.Infrastructure.Tests.Unit\AStar.Dev.Infrastructure.Tests.Unit.csproj", "{1EC059E7-7C8D-4492-8C07-30BD79AEE465}"
40+
EndProject
41+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AStar.Dev.Infrastructure.FilesDb.Tests.Unit", "test\AStar.Dev.Infrastructure.FilesDb.Tests.Unit\AStar.Dev.Infrastructure.FilesDb.Tests.Unit.csproj", "{019990B2-EFCD-4FB1-9FD1-CD98CCBFF670}"
42+
EndProject
3943
Global
4044
GlobalSection(SolutionConfigurationPlatforms) = preSolution
4145
Debug|Any CPU = Debug|Any CPU
@@ -66,6 +70,14 @@ Global
6670
{626B3E85-6C5D-4D8B-96BB-BF2D375326CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
6771
{626B3E85-6C5D-4D8B-96BB-BF2D375326CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
6872
{626B3E85-6C5D-4D8B-96BB-BF2D375326CA}.Release|Any CPU.Build.0 = Release|Any CPU
73+
{1EC059E7-7C8D-4492-8C07-30BD79AEE465}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
74+
{1EC059E7-7C8D-4492-8C07-30BD79AEE465}.Debug|Any CPU.Build.0 = Debug|Any CPU
75+
{1EC059E7-7C8D-4492-8C07-30BD79AEE465}.Release|Any CPU.ActiveCfg = Release|Any CPU
76+
{1EC059E7-7C8D-4492-8C07-30BD79AEE465}.Release|Any CPU.Build.0 = Release|Any CPU
77+
{019990B2-EFCD-4FB1-9FD1-CD98CCBFF670}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
78+
{019990B2-EFCD-4FB1-9FD1-CD98CCBFF670}.Debug|Any CPU.Build.0 = Debug|Any CPU
79+
{019990B2-EFCD-4FB1-9FD1-CD98CCBFF670}.Release|Any CPU.ActiveCfg = Release|Any CPU
80+
{019990B2-EFCD-4FB1-9FD1-CD98CCBFF670}.Release|Any CPU.Build.0 = Release|Any CPU
6981
EndGlobalSection
7082
GlobalSection(SolutionProperties) = preSolution
7183
HideSolutionNode = FALSE
@@ -82,5 +94,7 @@ Global
8294
{FE38F9CD-8573-44D1-A03F-73D318B6E86D} = {F06BC983-3361-41B2-B64F-7A77A2E32782}
8395
{C00B2A62-E46E-4F6E-BC8A-39088261A17E} = {D61F13DC-3A32-42BE-8687-F795D7332A51}
8496
{626B3E85-6C5D-4D8B-96BB-BF2D375326CA} = {D61F13DC-3A32-42BE-8687-F795D7332A51}
97+
{1EC059E7-7C8D-4492-8C07-30BD79AEE465} = {D96E7D57-B3CF-4792-8532-59F03453A8B6}
98+
{019990B2-EFCD-4FB1-9FD1-CD98CCBFF670} = {D96E7D57-B3CF-4792-8532-59F03453A8B6}
8599
EndGlobalSection
86100
EndGlobal

src/AStar.Dev.Infrastructure.FilesDb/AStar.Dev.Infrastructure.FilesDb.xml

Lines changed: 0 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/AStar.Dev.Infrastructure.FilesDb/EnumerableExtensions.cs

Lines changed: 0 additions & 91 deletions
This file was deleted.

src/AStar.Dev.Infrastructure.FilesDb/Models/FileDetail.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public FileDetail(IFileInfo fileInfo)
5555
/// <summary>
5656
/// Gets the full name of the file with the path combined
5757
/// </summary>
58-
public string FullNameWithPath => Path.Combine(DirectoryName.Value, FileName.Value);
58+
public string FullNameWithPath => Path.Combine(DirectoryName.Value, FileName.Value ?? "");
5959

6060
/// <summary>
6161
/// Gets or sets the file size. I know, shocking...
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net9.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
<IsPackable>false</IsPackable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="coverlet.collector" Version="6.0.2"/>
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0"/>
13+
<PackageReference Include="Shouldly" Version="4.3.0"/>
14+
<PackageReference Include="xunit" Version="2.9.2"/>
15+
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2"/>
16+
</ItemGroup>
17+
18+
<ItemGroup>
19+
<Using Include="Xunit"/>
20+
</ItemGroup>
21+
22+
<ItemGroup>
23+
<ProjectReference Include="..\..\src\AStar.Dev.Infrastructure.FilesDb\AStar.Dev.Infrastructure.FilesDb.csproj"/>
24+
</ItemGroup>
25+
26+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"softDeleted": "2025-07-28T01:02:03+00:00",
3+
"softDeletePending": "2025-07-28T03:04:05+00:00",
4+
"hardDeletePending": "2025-07-28T02:03:04+00:00"
5+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using AStar.Dev.Infrastructure.FilesDb.Models;
2+
using AStar.Dev.Utilities;
3+
using Shouldly;
4+
5+
namespace AStar.Dev.Infrastructure.FilesDb.Tests.Unit.Models;
6+
7+
public class DeletionStatusShould
8+
{
9+
[Fact]
10+
public void ContainTheExpectedProperties()
11+
=> new DeletionStatus
12+
{
13+
SoftDeleted = new DateTimeOffset(2025, 7, 28, 1, 2, 3, TimeSpan.Zero),
14+
HardDeletePending = new DateTimeOffset(2025, 7, 28, 2, 3, 4, TimeSpan.Zero),
15+
SoftDeletePending = new DateTimeOffset(2025, 7, 28, 3, 4, 5, TimeSpan.Zero)
16+
}
17+
.ToJson()
18+
.ShouldMatchApproved();
19+
}

0 commit comments

Comments
 (0)