-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1487: Add functional test to ensure Sarif.Multitool.exe can be launc…
…hed. (#1489)
- Loading branch information
Larry Golding
committed
May 9, 2019
1 parent
1ab0ab4
commit e4c0bcc
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
src/Test.FunctionalTests.Sarif/MultitoolCommandLineTests.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,37 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using System.Diagnostics; | ||
using System.IO; | ||
using FluentAssertions; | ||
using Microsoft.CodeAnalysis.Sarif; | ||
using Xunit; | ||
|
||
namespace Microsoft.CodeAnalysis.Test.FunctionalTests.Sarif | ||
{ | ||
public class MultitoolCommandLineTests | ||
{ | ||
[Fact] | ||
[Trait(TestTraits.Bug, "1487")] | ||
public void Multitool_LaunchesAndRunsSuccessfully() | ||
{ | ||
string multitoolPath = Path.GetFullPath( | ||
Path.Combine( | ||
Directory.GetCurrentDirectory(), | ||
@"..\..\Sarif.Multitool\net461\Sarif.Multitool.exe")); | ||
|
||
ProcessStartInfo startInfo = new ProcessStartInfo(multitoolPath, @"validate v2\ConverterTestData\ContrastSecurity\WebGoat.xml.sarif") | ||
{ | ||
WindowStyle = ProcessWindowStyle.Hidden, | ||
CreateNoWindow = true | ||
}; | ||
|
||
using (Process process = Process.Start(startInfo)) | ||
{ | ||
process.WaitForExit(); | ||
|
||
process.ExitCode.Should().Be(0); | ||
} | ||
} | ||
} | ||
} |