NUnit.Framework.TestCaseData.SetName(string)

Here are the examples of the csharp api NUnit.Framework.TestCaseData.SetName(string) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

30 Examples 7

19 Source : TestRunner.cs
with MIT License
from arcusmaximus

private static IEnumerable GetForwardConversionTestCases()
        {
            List<replacedStyleOptions> options = replacedStyleOptionsList.LoadFromFile(Path.Combine(DllFolderPath, "StyleOptions.xml"));
            foreach (string replacedFilePath in Directory.EnumerateFiles(Path.Combine(DllFolderPath, "Files"), "*.replaced"))
            {
                string name = Path.GetFileNameWithoutExtension(replacedFilePath) + " (Forward)";
                string yttFilePath = Path.ChangeExtension(replacedFilePath, ".ytt");
                yield return new TestCaseData(replacedFilePath, options, yttFilePath).SetName(name);
            }
        }

19 Source : TestRunner.cs
with MIT License
from arcusmaximus

private static IEnumerable GetReverseConversionTestCases()
        {
            foreach (string yttFilePath in Directory.EnumerateFiles(Path.Combine(DllFolderPath, "Files"), "*.ytt"))
            {
                string name = Path.GetFileNameWithoutExtension(yttFilePath) + " (Reverse)";
                yield return new TestCaseData(yttFilePath).SetName(name);
            }
        }

19 Source : MultiSubscription.cs
with MIT License
from evilC

public IEnumerator GetEnumerator()
                {
                    yield return new TestCaseData(SubReqs.Button1, (short)100, 1).SetName("Subscriber to Button 1 should receive it's callback");
                    yield return new TestCaseData(SubReqs.Axis1, (short)200, 1).SetName("Subscriber to Axis 1 should receive it's callback");
                    yield return new TestCaseData(SubReqs.Pov1Up, (short)300, 1).SetName("Subscriber to POV 1 Up should receive it's callback");
                }

19 Source : ContainsKeyIndex.cs
with MIT License
from evilC

public IEnumerator GetEnumerator()
            {
                // Add
                yield return new TestCaseData(SubscriptionType.None, SubReqs.Button1).Returns(false).SetName("Before adding Button 1, there should not be Button1 subscriptions");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Button1).Returns(true).SetName("After adding Button 1, there should be Button1 subscriptions");
                yield return new TestCaseData(SubscriptionType.None, SubReqs.Button2).Returns(false).SetName("Before adding Button 2, there should not be Button2 subscriptions");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Button2).Returns(true).SetName("After adding Button 2, there should be Button2 subscriptions");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Button1Subscriber2).Returns(true).SetName("After adding Button 1 Subscriber 2, there should be Button1 subscriptions");

                yield return new TestCaseData(SubscriptionType.None, SubReqs.Axis1).Returns(false).SetName("Before adding Axis 1, there should not be Axis1 subscriptions");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Axis1).Returns(true).SetName("After adding Axis 1, there should be Axis1 subscriptions");
                yield return new TestCaseData(SubscriptionType.None, SubReqs.Axis2).Returns(false).SetName("Before adding Axis 2, there should not be Axis2 subscriptions");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Axis2).Returns(true).SetName("After adding Axis 2, there should be Axis2 subscriptions");

                yield return new TestCaseData(SubscriptionType.None, SubReqs.Pov1Up).Returns(false).SetName("Before adding POV 1 Up, there should not be POV1 subscriptions");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Pov1Up).Returns(true).SetName("After adding POV 1 Up, there should be POV1 subscriptions");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Pov1Right).Returns(true).SetName("After adding POV 1 Right, there should be POV1 subscriptions");
                yield return new TestCaseData(SubscriptionType.None, SubReqs.Pov2Up).Returns(false).SetName("Before adding POV 2 Up, there should not be POV2 subscriptions");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Pov2Up).Returns(true).SetName("After adding POV 2 Up, there should be POV2 subscriptions");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Pov2Right).Returns(true).SetName("After adding POV 2 Right, there should be POV2 subscriptions");

                // Remove
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Pov2Right).Returns(true).SetName("After removing POV 2 Right, there should be POV2 subscriptions");
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Pov2Up).Returns(false).SetName("After removing POV 2 Up, there should not be POV2 subscriptions");
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Pov1Right).Returns(true).SetName("After removing POV 1 Right, there should be POV1 subscriptions");
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Pov1Up).Returns(false).SetName("After removing POV 1 Up, there should not be POV1 subscriptions");

                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Axis2).Returns(false).SetName("After removing Axis 2, there should not be Axis2 subscriptions");
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Axis1).Returns(false).SetName("After removing Axis 1, there should not be Axis1 subscriptions");

                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Button2).Returns(false).SetName("After removing Button 2, there should not be Button2 subscriptions");
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Button1).Returns(true).SetName("After removing Button 1, there should be Button1 subscriptions");
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Button1Subscriber2).Returns(false).SetName("After removing Button 1 Subscriber 2, there should not be Button1 subscriptions");
            }

19 Source : ContainsKeyType.cs
with MIT License
from evilC

public IEnumerator GetEnumerator()
            {
                // Add
                yield return new TestCaseData(SubscriptionType.None, SubReqs.Button1).Returns(false).SetName("Before adding Button 1, Buttons should not exist");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Button1).Returns(true).SetName("After adding Button 1, Buttons should exist");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Button2).Returns(true).SetName("After adding Button 2, Buttons should exist");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Button1Subscriber2).Returns(true).SetName("After adding Button 1 Subscriber 2, Buttons should exist");

                yield return new TestCaseData(SubscriptionType.None, SubReqs.Axis1).Returns(false).SetName("Before adding Axis 1, Axes should not exist");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Axis1).Returns(true).SetName("After adding Axis 1, Axes should exist");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Axis2).Returns(true).SetName("After adding Axis 2, Axes should exist");

                yield return new TestCaseData(SubscriptionType.None, SubReqs.Pov1Up).Returns(false).SetName("Before adding POV 1 Up, POVs should not exist");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Pov1Up).Returns(true).SetName("After adding POV 1 Up, POVs should exist");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Pov1Right).Returns(true).SetName("After adding POV 1 Right, POVs should exist");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Pov2Up).Returns(true).SetName("After adding POV 2 Up, there POVs should exist");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Pov2Right).Returns(true).SetName("After adding POV 2 Right, POVs should exist");

                // Remove
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Pov2Right).Returns(true).SetName("After removing POV 2 Right, POVs should exist");
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Pov2Up).Returns(true).SetName("After removing POV 2 Up, POVs should exist");
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Pov1Right).Returns(true).SetName("After removing POV 1 Right, POVs should exist");
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Pov1Up).Returns(false).SetName("After removing POV 1 Up, POVs should not exist");

                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Axis2).Returns(true).SetName("After removing Axis 2, Axes should exist");
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Axis1).Returns(false).SetName("After removing Axis 1, Axes should not exist");

                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Button2).Returns(true).SetName("After removing Button 2, Buttons should exist");
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Button1).Returns(true).SetName("After removing Button 1, Buttons should exist");
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Button1Subscriber2).Returns(false).SetName("After removing Button 1 Subscriber 2, Buttons should not exist");
            }

19 Source : CountIndex.cs
with MIT License
from evilC

public IEnumerator GetEnumerator()
            {
                // Add
                yield return new TestCaseData(SubscriptionType.None, SubReqs.Button1).Returns(0).SetName("Before adding Button 1, there should be 0 Buttons");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Button1).Returns(1).SetName("After adding Button 1, there should be 1 Button");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Button2).Returns(2).SetName("After adding Button 2, there should be 2 Buttons");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Button1Subscriber2).Returns(2).SetName("After adding Button 1 Subscriber 2, there should be 2 Buttons");

                yield return new TestCaseData(SubscriptionType.None, SubReqs.Axis1).Returns(0).SetName("Before adding Axis 1, there should be 0 Axes");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Axis1).Returns(1).SetName("After adding Axis 1, there should be 1 Axis");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Axis2).Returns(2).SetName("After adding Axis 2, there should be 2 Axes");

                yield return new TestCaseData(SubscriptionType.None, SubReqs.Pov1Up).Returns(0).SetName("Before adding POV 1 Up, there should be 0 POVs");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Pov1Up).Returns(1).SetName("After adding POV 1 Up, there should be 1 POV");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Pov1Right).Returns(1).SetName("After adding POV 1 Right, there should be 1 POV");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Pov2Up).Returns(2).SetName("After adding POV 2 Up, there should be 2 POVs");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Pov2Right).Returns(2).SetName("After adding POV 2 Right, there should be 2 POVs");

                // Remove
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Pov2Right).Returns(2).SetName("After removing POV 2 Right, there should be 2 POVs");
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Pov2Up).Returns(1).SetName("After removing POV 2 Up, there should be 1 POV");
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Pov1Right).Returns(1).SetName("After removing POV 1 Right, there should be 1 POV");
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Pov1Up).Returns(0).SetName("After removing POV 1 Up, there should be 0 POVs");

                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Axis2).Returns(1).SetName("After removing Axis 2, there should be 1 Axis");
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Axis1).Returns(0).SetName("After removing Axis 1, there should be 0 Axes");

                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Button2).Returns(1).SetName("After removing Button 2, there should be 1 Buttons");
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Button1Subscriber2).Returns(1).SetName("After removing Button 1 Subscriber 2, there should be 1 Button");
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Button1).Returns(0).SetName("After removing Button 1, there should be 0 Buttons");
            }

19 Source : CountSubIndex.cs
with MIT License
from evilC

public IEnumerator GetEnumerator()
            {
                // Add
                yield return new TestCaseData(SubscriptionType.None, SubReqs.Button1).Returns(0).SetName("Before adding Button 0, there should be 0 SubIndexes");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Button1).Returns(1).SetName("After adding Button 1, there should be 1 SubIndex");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Button2).Returns(1).SetName("After adding Button 2, there should be 1 SubIndex");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Button1Subscriber2).Returns(1).SetName("After adding Button 1 Subscriber 2, there should be 1 SubIndex");

                yield return new TestCaseData(SubscriptionType.None, SubReqs.Axis1).Returns(0).SetName("Before adding Axis 1, there should be 0 SubIndexes");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Axis1).Returns(1).SetName("After adding Axis 1, there should be 1 SubIndex");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Axis2).Returns(1).SetName("After adding Axis 2, there should be 1 SubIndex");

                yield return new TestCaseData(SubscriptionType.None, SubReqs.Pov1Up).Returns(0).SetName("Before adding POV 1 Up, there should be 0 SubIndexes");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Pov1Up).Returns(1).SetName("After adding POV 1 Up, there should be 1 SubIndex");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Pov1Right).Returns(2).SetName("After adding POV 1 Right, there should be 2 SubIndexes");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Pov2Up).Returns(1).SetName("After adding POV 2 Up, there should be 1 SubIndex");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Pov2Right).Returns(2).SetName("After adding POV 2 Right, there should be 2 SubIndexes");

                // Remove
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Pov2Right).Returns(1).SetName("After removing POV 2 Right, there should be 1 SubIndex");
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Pov2Up).Returns(0).SetName("After removing POV 2 Up, there should be 0 SubIndexes");
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Pov1Right).Returns(1).SetName("After removing POV 1 Right, there should be 1 SubIndex");
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Pov1Up).Returns(0).SetName("After removing POV 1 Up, there should be 0 SubIndexes");

                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Axis2).Returns(0).SetName("After removing Axis 2, there should be 0 SubIndexes");
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Axis1).Returns(0).SetName("After removing Axis 1, there should be 0 SubIndexes");

                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Button2).Returns(0).SetName("After removing Button 2, there should be 0 SubIndexes");
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Button1Subscriber2).Returns(1).SetName("After removing Button 1 Subscriber 2, there should be 1 SubIndex");
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Button1).Returns(0).SetName("After removing Button 1, there should be 0 SubIndexes");
            }

19 Source : CountType.cs
with MIT License
from evilC

public IEnumerator GetEnumerator()
            {
                // Add
                yield return new TestCaseData(SubscriptionType.None, SubReqs.Button1).Returns(0).SetName("Before adding Button 1, there should be 0 Types");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Button1).Returns(1).SetName("After adding Button 1, there should be 1 Type");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Button2).Returns(1).SetName("After adding Button 2, there should be 1 Type");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Button1Subscriber2).Returns(1).SetName("After adding Button 1 Subscriber 2, there should be 1 Type");

                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Axis1).Returns(2).SetName("After adding Axis 1, there should be 2 Types");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Axis2).Returns(2).SetName("After adding Axis 2, there should be 2 Types");

                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Pov1Up).Returns(3).SetName("After adding POV 1 Up, there should be 3 Types");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Pov1Right).Returns(3).SetName("After adding POV 1 Right, there should be 3 Types");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Pov2Up).Returns(3).SetName("After adding POV 2 Up, there should be 3 Types");
                yield return new TestCaseData(SubscriptionType.Subscribe, SubReqs.Pov2Right).Returns(3).SetName("After adding POV 2 Right, there should be 3 Types");

                // Remove
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Pov2Right).Returns(3).SetName("After removing POV 2 Right, there should be 3 Types");
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Pov2Up).Returns(3).SetName("After removing POV 2 Up, there should be 3 Types");
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Pov1Right).Returns(3).SetName("After removing POV 1 Right, there should be 3 Types");
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Pov1Up).Returns(2).SetName("After removing POV 1 Up, there should be 2 Types");

                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Axis2).Returns(2).SetName("After removing Axis 2, there should be 2 Types");
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Axis1).Returns(1).SetName("After removing Axis 1, there should be 1 Type");

                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Button2).Returns(1).SetName("After removing Button 2, there should be 1 Type");
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Button1Subscriber2).Returns(1).SetName("After removing Button 1 Subscriber 2, there should be 1 Type");
                yield return new TestCaseData(SubscriptionType.Unsubscribe, SubReqs.Button1).Returns(0).SetName("After removing Button 1, there should be 0 Types");
            }

19 Source : MultiSubscriber.cs
with MIT License
from evilC

public IEnumerator GetEnumerator()
            {
                yield return new TestCaseData(SubReqs.Button1, (short)100).SetName("Subscriber 1 to Button 1 should receive the callback");
                yield return new TestCaseData(SubReqs.Button1Subscriber2, (short)100).SetName("Subscriber 2 to Button 1 should receive the callback");
            }

19 Source : MultiSubscription.cs
with MIT License
from evilC

public IEnumerator GetEnumerator()
                {
                    yield return new TestCaseData(SubReqs.Button1, (short)100, 1).SetName("Subscriber to Button 1 should receive it's callback");
                    yield return new TestCaseData(SubReqs.Button2, (short)200, 1).SetName("Subscriber to Button 2 should receive it's callback");
                }

19 Source : EmptyHandler.cs
with MIT License
from evilC

public IEnumerator GetEnumerator()
            {
                yield return new TestCaseData(SubReqs.Pov2Right).Returns(0).SetName("After removing POV 2 Right, EmptyHandler should not fire");
                yield return new TestCaseData(SubReqs.Pov2Up).Returns(0).SetName("After removing POV 2 Up, EmptyHandler should not fire");
                yield return new TestCaseData(SubReqs.Pov1Right).Returns(0).SetName("After removing POV 1 Right, EmptyHandler should not fire");
                yield return new TestCaseData(SubReqs.Pov1Up).Returns(0).SetName("After removing POV 1 Up, EmptyHandler should not fire");
                yield return new TestCaseData(SubReqs.Axis2).Returns(0).SetName("After removing Axis 2, EmptyHandler should not fire");
                yield return new TestCaseData(SubReqs.Axis1).Returns(0).SetName("After removing Axis 1, EmptyHandler should not fire");
                yield return new TestCaseData(SubReqs.Button2).Returns(0).SetName("After removing Button 2, EmptyHandler should not fire");
                yield return new TestCaseData(SubReqs.Button1Subscriber2).Returns(0).SetName("After removing Button 1 Subscriber 2, EmptyHandler should not fire");
                yield return new TestCaseData(SubReqs.Button1).Returns(1).SetName("After removing Button 1, EmptyHandler should fire");
            }

19 Source : LfsVersionOutputProcessorTests.cs
with MIT License
from github-for-unity

public static IEnumerable<TestCaseData> ShouldParseVersionOutputs_TestCases()
        {
            yield return new TestCaseData(
                $"git-lfs/2.2.0 (GitHub; windows amd64; go 1.8.3; git a99f4b21){Environment.NewLine}", 
                TheVersion.Parse("2.2")).SetName("Windows GitLFS 2.2.0");

            yield return new TestCaseData(
                $"git-lfs/2.2.0 (GitHub; darwin amd64; go 1.8.3){Environment.NewLine}",
                TheVersion.Parse("2.2")).SetName("Mac GitLFS 2.2.0");
        }

19 Source : VersionOutputProcessorTests.cs
with MIT License
from github-for-unity

public static IEnumerable<TestCaseData> ShouldParseVersionOutputs_TestCases()
        {
            yield return new TestCaseData(
                $"git version 2.11.1.windows.1{Environment.NewLine}",
                TheVersion.Parse("2.11.1.windows.1")).SetName("Windows 2.11.1");

            yield return new TestCaseData(
                $"git version 2.12.2{Environment.NewLine}",
                TheVersion.Parse("2.12.2")).SetName("Mac 2.12.2");
        }

19 Source : WindowsGitEnvironmentTests.cs
with MIT License
from github-for-unity

public static IEnumerable<TestCaseData> GetDefaultGitPath_TestCases()
        {
            const string localAppDataPath = @"C:\Users\Stanley\AppData\Local";

            var gitHubRootPath = Path.Combine(localAppDataPath, "GitHub");

            var gitHubRootPathChildren = new[]
                {
                    "IgnoreTemplates_d0aa732a2b4666b3029e2320f1a06cd39e99c9fc",
                    "lfs-amd64_1.3.1",
                    "PortableGit_d7effa1a4a322478cd29c826b52a0c118ad3db11",
                    "TutorialRepository_d0aa732a2b4666b3029e2320f1a06cd39e99c9fc",
                }
                .Select(s => Path.Combine(gitHubRootPath, s))
                .ToArray();

            var gitExecutablePath = Path.Combine(localAppDataPath, @"GitHub\PortableGit_d7effa1a4a322478cd29c826b52a0c118ad3db11\cmd\git.exe");

            var testCase = new TestCaseData(localAppDataPath, gitHubRootPath, gitHubRootPathChildren, gitExecutablePath);
            testCase.SetName("Should be found");
            yield return testCase;

            gitHubRootPathChildren = new[]
                {
                    "IgnoreTemplates_d0aa732a2b4666b3029e2320f1a06cd39e99c9fc",
                    "lfs-amd64_1.3.1",
                    "TutorialRepository_d0aa732a2b4666b3029e2320f1a06cd39e99c9fc",
                }
                .Select(s => Path.Combine(gitHubRootPath, s))
                .ToArray();

            testCase = new TestCaseData(localAppDataPath, gitHubRootPath, gitHubRootPathChildren, null);
            testCase.SetName("Should be null");
            yield return testCase;
        }

19 Source : WindowsGitEnvironmentTests.cs
with MIT License
from github-for-unity

public static IEnumerable<TestCaseData> ValidateGitPath_TestCases()
        {
            var testCase = new TestCaseData(true, true);
            testCase.SetName("Should be found");
            yield return testCase;

            testCase = new TestCaseData(false, false);
            testCase.SetName("Should not be found");
            yield return testCase;
        }

19 Source : TestCommons.cs
with Apache License 2.0
from marko-vasic

public static List<TestCaseData> GetTestData(string testDirPath, string configurationTemplate, string testNameSuffix)
        {
            List<string> configurations = GetTestConfigurations(testDirPath, configurationTemplate);
            List<TestCaseData> testDataList = new List<TestCaseData>();

            foreach (string configuration in configurations)
            {
                var programArgs = JsonConvert.DeserializeObject<TestProjectRunnerArguments>(configuration);
                var testName = $"{GetTestName(programArgs.Versions[0])}_{testNameSuffix}";
                var testData = new TestCaseData(configuration);
                testData.SetName(testName);
                testDataList.Add(testData);
            }

            return testDataList;
        }

19 Source : UnicodeTextTests.cs
with MIT License
from mhwlng

private TestCaseData BuildTestCase(UnicodeRange input)
        {
            return new TestCaseData(input).SetName(input.Name);
        }

19 Source : DirectoryWrapperTests.cs
with Apache License 2.0
from nesfit

private static IEnumerable<TestCaseData> GetDeleteTestCases()
        {
            yield return new TestCaseData(true,false)
                .SetName("Delete_FilesLocked_WaitingForUnlock");
            yield return new TestCaseData(false,true)
                .SetName("Delete_FilesNotLocked_DeleteFiles");
        }

19 Source : JSTests.cs
with ISC License
from oberbichler

static TestCaseData LoadTestCaseData(string filename, int expectedTriangles, double expectedDeviation = 1e-14)
        {
            var path = Path.Combine(replacedemblyDirectory, "fixtures", filename + ".json");

            var polylines = JArray.Parse(File.ReadAllText(path));

            var data = new List<double>();
            var holeIndices = new List<int>();

            foreach (var polyline in polylines)
            {
                if (data.Any())
                {
                    holeIndices.Add(data.Count / 2);
                }

                foreach (var point in polyline)
                {
                    data.Add((double)point[0]);
                    data.Add((double)point[1]);
                }
            }

            return new TestCaseData(data, holeIndices, expectedTriangles, expectedDeviation).SetName(filename);
        }

19 Source : Tests.Operators.cs
with MIT License
from Unity-Technologies

protected static IEnumerable Arithmetic_Operators_With_Object_Typed_Var_Scenarios()
        {
            var typeValueMapping = new Dictionary<string, string>
            {
                {"float", "1F"},
                {"int", "1"},
                {"long", "1"},
            };

            foreach (var typeName in new[] {"float", "int", "long"})
            {
                var valueSufix = typeName[0] != 'i' ? typeName.Substring(0, 1) : "";

                yield return new TestCaseData(typeName, $"f > o + 1{valueSufix}", $"f > ((({typeName}) o) + 1{valueSufix})").SetName($"Simple ({typeName})");
                yield return new TestCaseData(typeName, $"o + 1{valueSufix} > f", $"((({typeName}) o) + 1{valueSufix}) > f").SetName($"Simle - Reversed ({typeName})");
                yield return new TestCaseData(typeName, $"(f > 2) && (f > o + 1{valueSufix})", $"(f > 2) && (f > ((({typeName}) o) + 1{valueSufix}))").SetName($"Composed ({typeName})");
                yield return new TestCaseData(typeName, $"(f > 2) && (f > o + 1{valueSufix})", $"(f > 2) && (f > ((({typeName}) o) + 1{valueSufix}))").SetName($"Composed - Reversed ({typeName})");
            }
        }

19 Source : Tests.Statements.Switch.cs
with MIT License
from Unity-Technologies

private static IEnumerable Switch_On_Non_Const_Scenarios()
        {
            yield return new TestCaseData(
                "function F(name:String, tbc:String) { switch(name) { case tbc: return 1; default: return 3; } }",
                "public virtual int F(string name, string tbc) { switch (name) { default: if (name == tbc) { return 1; } return 3; break; } }")
                .SetName("Existing Default");

            yield return new TestCaseData(
                "function F(name:String, tbc:String) { switch(name) { case tbc: return 1; } }",
                "public virtual int F(string name, string tbc) { switch (name) { default: if (name == tbc) { return 1; } break; } }")
                .SetName("With No Default");

            yield return new TestCaseData(
                "function F(name:String, tbc:String) { switch(name) { case System.Environment.MachineName: return 1; case tbc: return 2; } }",
                "public virtual int F(string name, string tbc) { switch (name) { default: if (name == System.Environment.MachineName) { return 1; }  if (name == tbc) { return 2; } break; } }")
                .SetName("Multiple Non Constant Expressions");

            yield return new TestCaseData(
                "function F(i:int, tbc:int) { switch(i) { case 1: return -1; case tbc: return 2; } }",
                "public virtual int F(int i, int tbc) { switch (i) { case 1: return -1; default: if (i == tbc) { return 2; } break; } }")
                .SetName("Mixed Const/Non Const");

            yield return new TestCaseData(
                "function F(i:int) { switch(i) { case System.Environment.ProcessorCount:\r\ncase i:\r\n return -1; } }",
                "public virtual int F(int i) { switch (i) { default: if ((i == System.Environment.ProcessorCount) || (i == i)) { return -1; } break; } }")
                .SetName("With Fall Throughs");

            yield return new TestCaseData(
                "function F(i:int) { switch(i) { case i:\r\ncase 42:\r\n return -1; } }",
                "public virtual int F(int i) { switch (i) { default: if ((i == i) || (i == 42)) { return -1; } break; } }")
                .SetName("With Mixed Fall Throughs - Simple References");

            yield return new TestCaseData(
                "function F(i:int) { switch(i) { case System.Environment.ProcessorCount:\r\ncase 42:\r\n return -1; } }",
                "public virtual int F(int i) { switch (i) { default: if ((i == System.Environment.ProcessorCount) || (i == 42)) { return -1; } break; } }")
                .SetName("With Mixed Fall Throughs - Property");

            yield return new TestCaseData(
                "function M(i:int) { return i; } function F(i:int) { switch(i) { case M(i):\r\ncase 42:\r\n return -1; } }",
                "public virtual int M(int i) { return i; } public virtual int F(int i) { switch (i) { default: if ((i == this.M(i)) || (i == 42)) { return -1; } break; } }")
                .SetName("With Mixed Fall Throughs - Method");
        }

19 Source : CommonColorTests.cs
with MIT License
from xamarin

private static IEnumerable HueColorFromColorCases() {
			foreach (KeyValuePair<string, ColorTestCase> testCaseKVP in PrimaryTestCases) {
				yield return new TestCaseData (testCaseKVP.Value.Color)
					.Returns (CommonColor.GetHueColorFromHue(testCaseKVP.Value.Color.Hue))
					.SetName ("HueColorFromColor_" + testCaseKVP.Key);
			}
			foreach (KeyValuePair<string, ColorTestCase> testCaseKVP in RGBTestCases) {
				yield return new TestCaseData (testCaseKVP.Value.Color)
					.Returns (CommonColor.GetHueColorFromHue (testCaseKVP.Value.Color.Hue))
					.SetName ("HueColorFromColor_" + testCaseKVP.Key);
			}
		}

19 Source : CommonColorTests.cs
with MIT License
from xamarin

private static IEnumerable CMYKFromColorCases () {
			foreach (KeyValuePair<string, ColorTestCase> testCaseKVP in PrimaryTestCases) {
				yield return new TestCaseData (testCaseKVP.Value.Color).Returns (testCaseKVP.Value.CMYK).SetName ("CMYKFromColor_" + testCaseKVP.Key);
			}
			foreach (KeyValuePair<string, ColorTestCase> testCaseKVP in RGBTestCases) {
				yield return new TestCaseData (testCaseKVP.Value.Color).Returns (testCaseKVP.Value.CMYK).SetName ("CMYKFromColor_" + testCaseKVP.Key);
			}
		}

19 Source : CommonColorTests.cs
with MIT License
from xamarin

private static IEnumerable ColorFromCMYKCases ()
		{
			foreach (KeyValuePair<string, ColorTestCase> testCaseKVP in PrimaryTestCases) {
				yield return new TestCaseData (testCaseKVP.Value.CMYK).Returns (testCaseKVP.Value.Color).SetName ("ColorFromCMYK_" + testCaseKVP.Key);
			}
			foreach (KeyValuePair<string, ColorTestCase> testCaseKVP in RGBTestCases) {
				yield return new TestCaseData (testCaseKVP.Value.CMYK).Returns (testCaseKVP.Value.Color).SetName ("ColorFromCMYK_" + testCaseKVP.Key);
			}
		}

19 Source : CommonColorTests.cs
with MIT License
from xamarin

private static IEnumerable HLSFromColorCases()
		{
			foreach(KeyValuePair<string, ColorTestCase> testCaseKVP in PrimaryTestCases) {
				yield return new TestCaseData (testCaseKVP.Value.Color).Returns (testCaseKVP.Value.HLS).SetName ("HLSFromColor_" + testCaseKVP.Key);
			}
			foreach (KeyValuePair<string, ColorTestCase> testCaseKVP in RGBTestCases) {
				yield return new TestCaseData (testCaseKVP.Value.Color).Returns (testCaseKVP.Value.HLS).SetName ("HLSFromColor_" + testCaseKVP.Key);
			}
		}

19 Source : CommonColorTests.cs
with MIT License
from xamarin

private static IEnumerable ColorFromHLSCases ()
		{
			foreach (KeyValuePair<string, ColorTestCase> testCaseKVP in PrimaryTestCases) {
				yield return new TestCaseData (testCaseKVP.Value.HLS).Returns (testCaseKVP.Value.Color).SetName ("ColorFromHLS_" + testCaseKVP.Key);
			}
			// HLS -> RGB conversion is the least reliable, and round-tripping it doesn't quite guarantee accurate enough results that they can be tested for arbitrary colors.
			//foreach (KeyValuePair<string, ColorTestCase> testCaseKVP in RGBTestCases) {
			//	yield return new TestCaseData (testCaseKVP.Value.HLS).Returns (testCaseKVP.Value.Color).SetName ("ColorFromHLS_" + testCaseKVP.Key);
			//}
		}

19 Source : CommonColorTests.cs
with MIT License
from xamarin

private static IEnumerable HLSRoundTripCases ()
		{
			foreach (KeyValuePair<string, ColorTestCase> testCaseKVP in PrimaryTestCases) {
				yield return new TestCaseData (testCaseKVP.Value.HLS).Returns (testCaseKVP.Value.HLS).SetName ("HLSRoundTrip_" + testCaseKVP.Key);
			}
			foreach (KeyValuePair<string, ColorTestCase> testCaseKVP in RGBTestCases) {
				yield return new TestCaseData (testCaseKVP.Value.HLS).Returns (testCaseKVP.Value.HLS).SetName ("HLSRoundTrip_" + testCaseKVP.Key);
			}
		}

19 Source : CommonColorTests.cs
with MIT License
from xamarin

private static IEnumerable HSBFromColorCases ()
		{
			foreach (KeyValuePair<string, ColorTestCase> testCaseKVP in PrimaryTestCases) {
				yield return new TestCaseData (testCaseKVP.Value.Color).Returns (testCaseKVP.Value.HSB).SetName ("HSBFromColor_" + testCaseKVP.Key);
			}
			foreach (KeyValuePair<string, ColorTestCase> testCaseKVP in RGBTestCases) {
				yield return new TestCaseData (testCaseKVP.Value.Color).Returns (testCaseKVP.Value.HSB).SetName ("HSBFromColor_" + testCaseKVP.Key);
			}
		}

19 Source : CommonColorTests.cs
with MIT License
from xamarin

private static IEnumerable ColorFromHSBCases ()
		{
			foreach (KeyValuePair<string, ColorTestCase> testCaseKVP in PrimaryTestCases) {
				yield return new TestCaseData (testCaseKVP.Value.HSB).Returns (testCaseKVP.Value.Color).SetName ("ColorFromHSB_" + testCaseKVP.Key);
			}
			foreach (KeyValuePair<string, ColorTestCase> testCaseKVP in RGBTestCases) {
				yield return new TestCaseData (testCaseKVP.Value.HSB).Returns (testCaseKVP.Value.Color).SetName ("ColorFromHSB_" + testCaseKVP.Key);
			}
		}

19 Source : CommonColorTests.cs
with MIT License
from xamarin

private static IEnumerable HSBRoundTripCases ()
		{
			foreach (KeyValuePair<string, ColorTestCase> testCaseKVP in PrimaryTestCases) {
				yield return new TestCaseData (testCaseKVP.Value.HSB).Returns (testCaseKVP.Value.HSB).SetName ("HSBRoundTrip_" + testCaseKVP.Key);
			}
			foreach (KeyValuePair<string, ColorTestCase> testCaseKVP in RGBTestCases) {
				yield return new TestCaseData (testCaseKVP.Value.HSB).Returns (testCaseKVP.Value.HSB).SetName ("HSBRoundTrip_" + testCaseKVP.Key);
			}
		}