Test frameworks consolidated (#12672)

This commit is contained in:
Davide Giacometti
2021-08-16 15:25:06 +02:00
committed by GitHub
parent c3a51f9227
commit e96c0da265
53 changed files with 1018 additions and 924 deletions

View File

@@ -3,25 +3,25 @@
// See the LICENSE file in the project root for more information.
using Microsoft.Plugin.Program.ProgramArgumentParser;
using Mono.Collections.Generic;
using NUnit.Framework;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Wox.Plugin;
namespace Microsoft.Plugin.Program.UnitTests.ProgramArgumentParser
{
[TestFixture]
[TestClass]
public class ProgramArgumentParserTests
{
[TestCase("Microsoft Edge", "Microsoft Edge", null)]
[TestCase("Microsoft Edge ---inprivate", "Microsoft Edge ---inprivate", null)]
[TestCase("Microsoft Edge -- -inprivate", "Microsoft Edge", "-inprivate")]
[TestCase("Microsoft Edge -inprivate", "Microsoft Edge", "-inprivate")]
[TestCase("Microsoft Edge /inprivate", "Microsoft Edge", "/inprivate")]
[TestCase("edge.exe --inprivate", "edge.exe", "--inprivate")]
[TestCase("edge.exe -- --inprivate", "edge.exe", "--inprivate")]
[TestCase("edge.exe", "edge.exe", null)]
[TestCase("edge", "edge", null)]
[TestCase("cmd /c \"ping 1.1.1.1\"", "cmd", "/c \"ping 1.1.1.1\"")]
[DataTestMethod]
[DataRow("Microsoft Edge", "Microsoft Edge", null)]
[DataRow("Microsoft Edge ---inprivate", "Microsoft Edge ---inprivate", null)]
[DataRow("Microsoft Edge -- -inprivate", "Microsoft Edge", "-inprivate")]
[DataRow("Microsoft Edge -inprivate", "Microsoft Edge", "-inprivate")]
[DataRow("Microsoft Edge /inprivate", "Microsoft Edge", "/inprivate")]
[DataRow("edge.exe --inprivate", "edge.exe", "--inprivate")]
[DataRow("edge.exe -- --inprivate", "edge.exe", "--inprivate")]
[DataRow("edge.exe", "edge.exe", null)]
[DataRow("edge", "edge", null)]
[DataRow("cmd /c \"ping 1.1.1.1\"", "cmd", "/c \"ping 1.1.1.1\"")]
public void ProgramArgumentParserTestsCanParseQuery(string inputQuery, string expectedProgram, string expectedProgramArguments)
{
// Arrange