Skip to content

Commit

Permalink
Fixes a bug where check command reported invalid number of files
Browse files Browse the repository at this point in the history
without metadata.
  • Loading branch information
Caleb9 committed Mar 30, 2021
1 parent 1858952 commit c82002d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
8 changes: 6 additions & 2 deletions CameraUtility.Tests/CheckFilesCommandTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ public void Check_directory_when_all_files_are_camera_files_but_some_are_missing
NewImageFileTags("2010:01:12 13:14:15", "42")),
(
$"{sourceDirPath}/IMG_2345.JPEG",
Array.Empty<ITag>()),
(
$"{sourceDirPath}/IMG_3456.jpg",
Array.Empty<ITag>())
};
SetupFileSystemStub(fixture, sourceDirPath, sourceFiles.Select(f => f.sourceFile));
Expand All @@ -86,9 +89,10 @@ public void Check_directory_when_all_files_are_camera_files_but_some_are_missing
result.Should().Be(0);
var output = consoleTextWriterMock.ToString();
output.Should().Be(
"Found 2 camera file(s). Missing metadata in 1 file(s).\n" +
"Found 3 camera file(s). Missing metadata in 2 file(s).\n" +
"Following files are missing metadata:\n" +
$"{sourceDirPath}/IMG_2345.JPEG\n");
$"{sourceDirPath}/IMG_2345.JPEG\n" +
$"{sourceDirPath}/IMG_3456.jpg\n");
}

[Fact]
Expand Down
3 changes: 3 additions & 0 deletions CameraUtility/CameraFilePath.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using System.Diagnostics;

namespace CameraUtility
{
[DebuggerDisplay("{" + nameof(Value) + "}")]
public sealed record CameraFilePath(string Value) :
TypedOption<string>(Value)
{
Expand Down
1 change: 0 additions & 1 deletion CameraUtility/CameraUtility.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

<ItemGroup>
<Folder Include="Properties\" />
<Folder Include="Utils" />
<None Include="..\LICENSE.txt">
<Pack>True</Pack>
<PackagePath />
Expand Down
2 changes: 1 addition & 1 deletion CameraUtility/Commands/Check/Output/ConsoleOutput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ internal void PrintSummary(
}

WriteLine(
$" Missing metadata in {cameraFilesCounter - cameraFilesWithoutMetadata.Count} file(s).",
$" Missing metadata in {cameraFilesWithoutMetadata.Count} file(s).",
ConsoleColor.Red);
WriteLine("Following files are missing metadata:");
foreach (var cameraFile in cameraFilesWithoutMetadata)
Expand Down

0 comments on commit c82002d

Please sign in to comment.