Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions RepoM.sln
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RepoM.Plugin.Clipboard", "s
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RepoM.Plugin.Clipboard.Tests", "tests\RepoM.Plugin.Clipboard.Tests\RepoM.Plugin.Clipboard.Tests.csproj", "{A26EF3E9-C267-499C-B5AB-E4FB3C7AB6E1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RepoM.Plugin.EverythingFileSearch.Tests", "tests\RepoM.Plugin.EverythingFileSearch.Tests\RepoM.Plugin.EverythingFileSearch.Tests.csproj", "{89D96078-2951-44C2-B5B1-1DA0D5E94C0C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -459,6 +461,26 @@ Global
{A26EF3E9-C267-499C-B5AB-E4FB3C7AB6E1}.Release|x64.Build.0 = Release|Any CPU
{A26EF3E9-C267-499C-B5AB-E4FB3C7AB6E1}.Release|x86.ActiveCfg = Release|Any CPU
{A26EF3E9-C267-499C-B5AB-E4FB3C7AB6E1}.Release|x86.Build.0 = Release|Any CPU
{89D96078-2951-44C2-B5B1-1DA0D5E94C0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{89D96078-2951-44C2-B5B1-1DA0D5E94C0C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{89D96078-2951-44C2-B5B1-1DA0D5E94C0C}.Debug|ARM.ActiveCfg = Debug|Any CPU
{89D96078-2951-44C2-B5B1-1DA0D5E94C0C}.Debug|ARM.Build.0 = Debug|Any CPU
{89D96078-2951-44C2-B5B1-1DA0D5E94C0C}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{89D96078-2951-44C2-B5B1-1DA0D5E94C0C}.Debug|ARM64.Build.0 = Debug|Any CPU
{89D96078-2951-44C2-B5B1-1DA0D5E94C0C}.Debug|x64.ActiveCfg = Debug|Any CPU
{89D96078-2951-44C2-B5B1-1DA0D5E94C0C}.Debug|x64.Build.0 = Debug|Any CPU
{89D96078-2951-44C2-B5B1-1DA0D5E94C0C}.Debug|x86.ActiveCfg = Debug|Any CPU
{89D96078-2951-44C2-B5B1-1DA0D5E94C0C}.Debug|x86.Build.0 = Debug|Any CPU
{89D96078-2951-44C2-B5B1-1DA0D5E94C0C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{89D96078-2951-44C2-B5B1-1DA0D5E94C0C}.Release|Any CPU.Build.0 = Release|Any CPU
{89D96078-2951-44C2-B5B1-1DA0D5E94C0C}.Release|ARM.ActiveCfg = Release|Any CPU
{89D96078-2951-44C2-B5B1-1DA0D5E94C0C}.Release|ARM.Build.0 = Release|Any CPU
{89D96078-2951-44C2-B5B1-1DA0D5E94C0C}.Release|ARM64.ActiveCfg = Release|Any CPU
{89D96078-2951-44C2-B5B1-1DA0D5E94C0C}.Release|ARM64.Build.0 = Release|Any CPU
{89D96078-2951-44C2-B5B1-1DA0D5E94C0C}.Release|x64.ActiveCfg = Release|Any CPU
{89D96078-2951-44C2-B5B1-1DA0D5E94C0C}.Release|x64.Build.0 = Release|Any CPU
{89D96078-2951-44C2-B5B1-1DA0D5E94C0C}.Release|x86.ActiveCfg = Release|Any CPU
{89D96078-2951-44C2-B5B1-1DA0D5E94C0C}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -478,6 +500,7 @@ Global
{1F18CE9A-8E4A-43AB-8E17-34F7564E2198} = {D6E372DC-10D3-4997-9DFC-568B4666635A}
{8F87B73D-8A5D-4335-96E9-97EE0495B671} = {D6E372DC-10D3-4997-9DFC-568B4666635A}
{A26EF3E9-C267-499C-B5AB-E4FB3C7AB6E1} = {D6E372DC-10D3-4997-9DFC-568B4666635A}
{89D96078-2951-44C2-B5B1-1DA0D5E94C0C} = {D6E372DC-10D3-4997-9DFC-568B4666635A}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1765ABAA-0652-4DA5-ABBF-05396F2957D7}
Expand Down
1 change: 1 addition & 0 deletions src/RepoM.Api/IO/GitRepositoryFinderFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ namespace RepoM.Api.IO;
using System.Collections.Generic;
using System.Linq;
using RepoM.Api.Common;
using RepoM.Core.Plugin.RepositoryFinder;

public class GitRepositoryFinderFactory : IGitRepositoryFinderFactory
{
Expand Down
1 change: 1 addition & 0 deletions src/RepoM.Api/IO/GravellGitRepositoryFinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ namespace RepoM.Api.IO;
using System.Collections.Generic;
using System.IO.Abstractions;
using System.Linq;
using RepoM.Core.Plugin.RepositoryFinder;

// http://stackoverflow.com/questions/2106877/is-there-a-faster-way-than-this-to-find-all-the-files-in-a-directory-and-all-sub
internal class GravellGitRepositoryFinder : IGitRepositoryFinder
Expand Down
1 change: 1 addition & 0 deletions src/RepoM.Api/IO/GravellGitRepositoryFinderFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ namespace RepoM.Api.IO;

using System;
using System.IO.Abstractions;
using RepoM.Core.Plugin.RepositoryFinder;

public class GravellGitRepositoryFinderFactory : ISingleGitRepositoryFinderFactory
{
Expand Down
2 changes: 2 additions & 0 deletions src/RepoM.Api/IO/IGitRepositoryFinderFactory.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
namespace RepoM.Api.IO;

using RepoM.Core.Plugin.RepositoryFinder;

public interface IGitRepositoryFinderFactory
{
IGitRepositoryFinder Create();
Expand Down
1 change: 1 addition & 0 deletions src/RepoM.Api/IO/WindowsPathSkipper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ namespace RepoM.Api.IO;
using System;
using System.Collections.Generic;
using System.Linq;
using RepoM.Core.Plugin.RepositoryFinder;

public class WindowsPathSkipper : IPathSkipper
{
Expand Down
1 change: 1 addition & 0 deletions src/RepoM.App/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ namespace RepoM.App;
using RepoM.App.RepositoryOrdering;
using RepoM.Core.Plugin.Common;
using RepoM.Core.Plugin.Expressions;
using RepoM.Core.Plugin.RepositoryFinder;

/// <summary>
/// Interaction logic for App.xaml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace RepoM.Api.IO;
namespace RepoM.Core.Plugin.RepositoryFinder;

using System;
using System.Collections.Generic;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace RepoM.Api.IO;
namespace RepoM.Core.Plugin.RepositoryFinder;

public interface IPathSkipper
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace RepoM.Api.IO;
namespace RepoM.Core.Plugin.RepositoryFinder;

public interface ISingleGitRepositoryFinderFactory
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ namespace RepoM.Plugin.EverythingFileSearch;

using System;
using JetBrains.Annotations;
using RepoM.Api.IO;
using RepoM.Core.Plugin.RepositoryFinder;
using RepoM.Plugin.EverythingFileSearch.Internal;

[UsedImplicitly]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
namespace RepoM.Plugin.EverythingFileSearch;

using JetBrains.Annotations;
using RepoM.Api.IO;
using RepoM.Core.Plugin.RepositoryFinder;
using SimpleInjector;
using SimpleInjector.Packaging;

[UsedImplicitly]
public class EverythingModule : IPackage
public class EverythingPackage : IPackage
{
public void RegisterServices(Container container)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace RepoM.Plugin.EverythingFileSearch.Internal;
using System;
using System.Collections.Generic;
using System.Linq;
using RepoM.Api.IO;
using RepoM.Core.Plugin.RepositoryFinder;

internal class EverythingGitRepositoryFinder : IGitRepositoryFinder
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\RepoM.Api\RepoM.Api.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\_ref\Everything64.dll" Link="Everything64.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\RepoM.Core.Plugin\RepoM.Core.Plugin.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
namespace RepoM.Plugin.EverythingFileSearch.Tests;

using System;
using FakeItEasy;
using FluentAssertions;
using RepoM.Core.Plugin.RepositoryFinder;
using RepoM.Plugin.EverythingFileSearch.Internal;
using Xunit;

public class EverythingGitRepositoryFinderFactoryTests
{
private readonly IPathSkipper _pathSkipper;

public EverythingGitRepositoryFinderFactoryTests()
{
_pathSkipper = A.Fake<IPathSkipper>();
}

[Fact]
public void Ctor_ShouldThrow_WhenArgumentIsNull()
{
// arrange

// act
Action act = () => _ = new EverythingGitRepositoryFinderFactory(null!);

// assert
act.Should().ThrowExactly<ArgumentNullException>();
}

[Fact]
public void Name_ShouldBeEverything()
{
// arrange
var sut = new EverythingGitRepositoryFinderFactory(_pathSkipper);

// act
var result = sut.Name;

// assert
result.Should().Be("Everything");
}

[Fact]
public void IsActive_ShouldReturnSameValueAsEverythingApi()
{
// arrange
var sut = new EverythingGitRepositoryFinderFactory(_pathSkipper);

// act
var result = sut.IsActive;

// assert
result.Should().Be(Everything64Api.IsInstalled());
}

[Fact]
public void Create_ShouldReturnSameValueAsEverythingApi()
{
// arrange
var sut = new EverythingGitRepositoryFinderFactory(_pathSkipper);

// act
IGitRepositoryFinder result = sut.Create();

// assert
result.Should().NotBeNull().And.BeOfType<EverythingGitRepositoryFinder>();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
namespace RepoM.Plugin.EverythingFileSearch.Tests;

using System;
using FakeItEasy;
using RepoM.Core.Plugin.RepositoryFinder;
using RepoM.Plugin.EverythingFileSearch;
using SimpleInjector;
using Xunit;

public class EverythingPackageTests
{
[Fact]
public void RegisterServices_ShouldBeSuccessful_WhenExternalDependenciesAreRegistered()
{
// arrange
var container = new Container();
RegisterExternals(container);
var sut = new EverythingPackage();

// act
sut.RegisterServices(container);

// assert
// implicit, Verify throws when container is not valid.
container.Verify(VerificationOption.VerifyAndDiagnose);
}

[Fact]
public void RegisterServices_ShouldFail_WhenExternalDependenciesAreNotRegistered()
{
// arrange
var container = new Container();
var sut = new EverythingPackage();

// act
sut.RegisterServices(container);

// assert
Assert.Throws<InvalidOperationException>(() => container.Verify(VerificationOption.VerifyAndDiagnose));
}

private static void RegisterExternals(Container container)
{
container.RegisterSingleton(A.Dummy<IPathSkipper>);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
namespace RepoM.Plugin.EverythingFileSearch.Tests.Internal;

using System;
using FakeItEasy;
using FluentAssertions;
using RepoM.Core.Plugin.RepositoryFinder;
using RepoM.Plugin.EverythingFileSearch.Internal;
using Xunit;

public class EverythingGitRepositoryFinderTests
{
[Fact]
public void Ctor_ShouldThrow_WhenArgumentIsNull()
{
// arrange

// act
Action act = () => _ = new EverythingGitRepositoryFinder(null!);

// assert
act.Should().ThrowExactly<ArgumentNullException>();
}

[Fact]
public void Ctor_ShouldNotThrown_WhenArgumentIsNotNull()
{
// arrange

// act
Action act = () => _ = new EverythingGitRepositoryFinder(A.Dummy<IPathSkipper>());

// assert
act.Should().NotThrow();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="3.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FakeItEasy" Version="7.3.1" />
<PackageReference Include="FakeItEasy.Analyzer.CSharp" Version="6.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="6.8.0" />
<PackageReference Include="Meziantou.Xunit.ParallelTestFramework" Version="2.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\RepoM.Plugin.EverythingFileSearch\RepoM.Plugin.EverythingFileSearch.csproj" />
</ItemGroup>

<ItemGroup>
<Folder Include="Internal\" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions tests/Specs/DefaultRepositoryMonitorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ namespace Specs;
using RepoM.Api.IO;
using RepoM.Api.IO.ModuleBasedRepositoryActionProvider;
using RepoM.Api.IO.VariableProviders;
using RepoM.Core.Plugin.RepositoryFinder;
using Specs.IO;
using Specs.Mocks;

Expand Down
1 change: 1 addition & 0 deletions tests/Specs/Mocks/NeverSkippingPathSkipper.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace Specs.Mocks;

using RepoM.Api.IO;
using RepoM.Core.Plugin.RepositoryFinder;

internal class NeverSkippingPathSkipper : IPathSkipper
{
Expand Down