Skip to content

Commit

Permalink
Merge pull request #145 from jibedoubleve/issue_144
Browse files Browse the repository at this point in the history
Issue 144
  • Loading branch information
jibedoubleve authored Mar 13, 2023
2 parents c6f8eb1 + d41a71d commit 982d84a
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Lanceur.Infra/Managers/ExecutionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public async Task<ExecutionResponse> ExecuteAsync(ExecutionRequest request)

var result = (request.QueryResult is AliasQueryResult alias)
? await ExecuteAliasAsync(alias)
: await exec.ExecuteAsync();
: await exec.ExecuteAsync(request.Cmdline);

return ExecutionResponse.FromResults(result);
}
Expand Down
44 changes: 44 additions & 0 deletions src/Lanceur.Tests/Functional/ExecutionManagerShould.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using FluentAssertions;
using Lanceur.Core.Managers;
using Lanceur.Core.Models;
using Lanceur.Core.Services;
using Lanceur.Infra.Managers;
using Lanceur.Macros;
using NSubstitute;
using Xunit;

namespace Lanceur.Tests.Functional
{
public class ExecutionManagerShould
{
#region Methods

[Fact]
public async Task ExecuteMultiMacro()
{
var mgr = new ExecutionManager(
Substitute.For<IAppLoggerFactory>(),
Substitute.For<IWildcardManager>(),
Substitute.For<IDataService>()
);

var macro = Substitute.For<MultiMacro>();
await macro.ExecuteAsync(
Arg.Do<Cmdline>(
x => x.Should().NotBeNull()
)
);

var request = new ExecutionRequest
{
Cmdline = new Cmdline("ini", "thb@joplin@spotify"),
ExecuteWithPrivilege = false,
QueryResult = macro
};

await mgr.ExecuteAsync(request);
}

#endregion Methods
}
}

0 comments on commit 982d84a

Please sign in to comment.