-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
66e63b4
commit 28cdd7a
Showing
15 changed files
with
78 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
CSharpInteractive.Tests/UsageScenarios/DotNetCsiScenario.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// ReSharper disable StringLiteralTypo | ||
// ReSharper disable ObjectCreationAsStatement | ||
// ReSharper disable ReturnValueOfPureMethodIsNotUsed | ||
|
||
namespace CSharpInteractive.Tests.UsageScenarios; | ||
|
||
using System.Diagnostics.CodeAnalysis; | ||
using HostApi; | ||
|
||
[CollectionDefinition("Integration", DisableParallelization = true)] | ||
[Trait("Integration", "True")] | ||
[SuppressMessage("Performance", "CA1861:Avoid constant arrays as arguments")] | ||
public class DotNetCsiScenario : BaseScenario | ||
{ | ||
[Fact] | ||
public void Run() | ||
{ | ||
// $visible=true | ||
// $tag=07 .NET CLI | ||
// $priority=02 | ||
// $description=Run C# script | ||
// { | ||
// Adds the namespace "HostApi" to use .NET build API | ||
// ## using HostApi; | ||
|
||
var script = Path.GetTempFileName(); | ||
File.WriteAllText(script, "Console.WriteLine($\"Hello, {Args[0]}!\");"); | ||
|
||
var stdOut = new List<string>(); | ||
var result = new DotNetCsi() | ||
.WithScript(script) | ||
.AddArgs("World") | ||
.Build(message => stdOut.Add(message.Text)) | ||
.EnsureSuccess(); | ||
|
||
result.ExitCode.ShouldBe(0); | ||
|
||
// Checks StdOut | ||
stdOut.Contains("Hello, World!").ShouldBeTrue(result.ToString()); | ||
// } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters