示例#1
0
 static string GetDisplayName(SupportedFramework sfx)
 {
     if (!string.IsNullOrEmpty(sfx.MinimumVersionDisplayName))
     {
         return(sfx.DisplayName + " " + sfx.MinimumVersionDisplayName);
     }
     else if (!string.IsNullOrEmpty(sfx.MonoSpecificVersionDisplayName))
     {
         return(sfx.DisplayName + " " + sfx.MonoSpecificVersionDisplayName);
     }
     else
     {
         return(sfx.DisplayName);
     }
 }
        static void InitProfiles()
        {
            // Profile 1 (.NETFramework + Silverlight + WindowsPhone + Xbox)
            NetPortableProfile1 = Runtime.SystemAssemblyService.GetTargetFramework(new TargetFrameworkMoniker(".NETPortable", "4.0", "Profile1"));
            SupportedFramework NetFramework = new SupportedFramework(NetPortableProfile1, ".NETFramework", ".NET Framework", "*", new Version(4, 0), "4");
            SupportedFramework Silverlight  = new SupportedFramework(NetPortableProfile1, "Silverlight", "Silverlight", "", new Version(4, 0), "4");
            SupportedFramework WindowsPhone = new SupportedFramework(NetPortableProfile1, "Silverlight", "Windows Phone", "WindowsPhone*", new Version(4, 0), "7");
            SupportedFramework Xbox         = new SupportedFramework(NetPortableProfile1, "Xbox", "Xbox 360", "*", new Version(4, 0), "");

            NetPortableProfile1.SupportedFrameworks.Add(NetFramework);
            NetPortableProfile1.SupportedFrameworks.Add(Silverlight);
            NetPortableProfile1.SupportedFrameworks.Add(WindowsPhone);
            NetPortableProfile1.SupportedFrameworks.Add(Xbox);

            // Profile 2 (.NETFramework + Silverlight + WindowsPhone)
            NetPortableProfile2 = Runtime.SystemAssemblyService.GetTargetFramework(new TargetFrameworkMoniker(".NETPortable", "4.0", "Profile2"));
            NetFramework        = new SupportedFramework(NetPortableProfile2, ".NETFramework", ".NET Framework", "*", new Version(4, 0), "4");
            Silverlight         = new SupportedFramework(NetPortableProfile2, "Silverlight", "Silverlight", "", new Version(4, 0), "4");
            WindowsPhone        = new SupportedFramework(NetPortableProfile2, "Silverlight", "Windows Phone", "WindowsPhone*", new Version(4, 0), "7");

            NetPortableProfile2.SupportedFrameworks.Add(NetFramework);
            NetPortableProfile2.SupportedFrameworks.Add(Silverlight);
            NetPortableProfile2.SupportedFrameworks.Add(WindowsPhone);

            // Profile 3 (.NETFramework + Silverlight)
            NetPortableProfile3 = Runtime.SystemAssemblyService.GetTargetFramework(new TargetFrameworkMoniker(".NETPortable", "4.0", "Profile3"));
            NetFramework        = new SupportedFramework(NetPortableProfile3, ".NETFramework", ".NET Framework", "*", new Version(4, 0), "4");
            Silverlight         = new SupportedFramework(NetPortableProfile3, "Silverlight", "Silverlight", "", new Version(4, 0), "4");

            NetPortableProfile3.SupportedFrameworks.Add(NetFramework);
            NetPortableProfile3.SupportedFrameworks.Add(Silverlight);

            // Profile 4 (Silverlight + WindowsPhone)
            NetPortableProfile4 = Runtime.SystemAssemblyService.GetTargetFramework(new TargetFrameworkMoniker(".NETPortable", "4.0", "Profile4"));
            Silverlight         = new SupportedFramework(NetPortableProfile4, "Silverlight", "Silverlight", "", new Version(4, 0), "4");
            WindowsPhone        = new SupportedFramework(NetPortableProfile4, "Silverlight", "Windows Phone", "WindowsPhone*", new Version(4, 0), "7");

            NetPortableProfile4.SupportedFrameworks.Add(Silverlight);
            NetPortableProfile4.SupportedFrameworks.Add(WindowsPhone);
        }
示例#3
0
        void SelectOption(SupportedFramework sfx)
        {
            foreach (var option in options)
            {
                for (int i = 0; i < option.Items.Count; i++)
                {
                    var item = option.Items[i];
                    if (!item.Framework.Equals(sfx))
                    {
                        continue;
                    }

                    option.Check.Active = true;
                    if (option.Combo != null)
                    {
                        option.Combo.Active = i;
                    }
                    return;
                }
            }

            throw new InvalidOperationException();
        }
示例#4
0
        static string GetShortName(SupportedFramework sfx)
        {
            switch (sfx.DisplayName)
            {
            case ".NET Framework":
                return("NET" + sfx.MinimumVersionDisplayName.Replace(".", ""));

            case "Silverlight":
                return("SL" + sfx.MinimumVersionDisplayName);

            case "Xamarin.Android":
                return("Android");

            case ".NET for Windows Store apps":
                return("WinStore");

            case "Windows Phone":
                return("WP" + sfx.MinimumVersionDisplayName.Replace(".", ""));

            case "Xbox 360":
                return("XBox");

            case "Xamarin.iOS":
                if (string.IsNullOrEmpty(sfx.MonoSpecificVersionDisplayName))
                {
                    return("iOS");
                }
                else
                {
                    return("iOS/" + sfx.MonoSpecificVersion);
                }

            default:
                return(GetDisplayName(sfx));
            }
        }
示例#5
0
 public OptionComboItem(string name, SupportedFramework sfx)
 {
     this.Name      = name;
     this.Framework = sfx;
 }
        private static List <TestCase> GetTestCases(ProjectName projectName, SupportedFramework testFramework)
        {
            var testCaseOptions = new TestCaseOptions()
            {
                TestFramework = testFramework,
                WorkingDir    = GetProjectDirPath(projectName),
                Source        = GetProjectFilePath(projectName),
                ConfigDirPath = projectName == ProjectName.NodeAppWithAngularTests ? GetProjectDirPath(projectName) : null
            };

            switch (testFramework)
            {
            case SupportedFramework.Jasmine:
            {
                var filePath = Path.Combine(GetProjectDirPath(projectName), "JasmineUnitTest.js");
                return(new List <TestCase>()
                    {
                        GetTestCase(testCaseOptions, "JasmineUnitTest.js::Test Suite 1::Test 1", "Test 1", 1, filePath),
                        GetTestCase(testCaseOptions, "JasmineUnitTest.js::Test Suite 1::Test 2", "Test 2", 1, filePath),
                    });
            }

            case SupportedFramework.ExportRunner:
            {
                var filePath = Path.Combine(GetProjectDirPath(projectName), "ExportRunnerUnitTest.js");
                return(new List <TestCase>()
                    {
                        GetTestCase(testCaseOptions, "ExportRunnerUnitTest.js::global::Test 1", "Test 1", 1, filePath),
                        GetTestCase(testCaseOptions, "ExportRunnerUnitTest.js::global::Test 2", "Test 2", 1, filePath),
                    });
            }

            case SupportedFramework.Jest:
            {
                var filePath = Path.Combine(GetProjectDirPath(projectName), "JestUnitTest.js");
                return(new List <TestCase>()
                    {
                        GetTestCase(testCaseOptions, "JestUnitTest.js::Test Suite 1::Test 1 - This shouldn't fail", "Test 1 - This shouldn't fail", 3, filePath),
                        GetTestCase(testCaseOptions, "JestUnitTest.js::Test Suite 1::Test 2 - This should fail", "Test 2 - This should fail", 7, filePath),
                    });
            }

            case SupportedFramework.Mocha:
            {
                var filePath = Path.Combine(GetProjectDirPath(projectName), "MochaUnitTest.js");
                return(new List <TestCase>()
                    {
                        GetTestCase(testCaseOptions, "MochaUnitTest.js::Test Suite 1::Test 1", "Test 1", 1, filePath),
                        GetTestCase(testCaseOptions, "MochaUnitTest.js::Test Suite 1::Test 2", "Test 2", 1, filePath),
                    });
            }

            case SupportedFramework.Tape:
            {
                var filePath = Path.Combine(GetProjectDirPath(projectName), "TapeUnitTest.js");
                return(new List <TestCase>()
                    {
                        GetTestCase(testCaseOptions, "TapeUnitTest.js::global::Test A", "Test A", 1, filePath),
                        GetTestCase(testCaseOptions, "TapeUnitTest.js::global::Test B", "Test B", 1, filePath),
                    });
            }

            case SupportedFramework.Angular:
                return(new List <TestCase>()
                {
                    GetTestCase(testCaseOptions, @"src\app\app.component.spec.ts::AppComponent::should create the app", "should create the app", 14, Path.Combine(GetProjectDirPath(projectName), @"src\app\app.component.spec.ts")),
                    GetTestCase(testCaseOptions, @"src\app\app.component.spec.ts::AppComponent::should have as title 'my-app'", "should have as title 'my-app'", 20, Path.Combine(GetProjectDirPath(projectName), @"src\app\app.component.spec.ts")),
                    GetTestCase(testCaseOptions, @"src\app\app.component.spec.ts::AppComponent::should render title", "should render title", 26, Path.Combine(GetProjectDirPath(projectName), @"src\app\app.component.spec.ts")),
                    GetTestCase(testCaseOptions, @"src\app\customTest.spec.ts::CustomTest::should succeed", "should succeed", 4, Path.Combine(GetProjectDirPath(projectName), @"src\app\customTest.spec.ts")),
                    GetTestCase(testCaseOptions, @"src\app\customTest.spec.ts::CustomTest::should fail", "should fail", 8, Path.Combine(GetProjectDirPath(projectName), @"src\app\customTest.spec.ts")),
                });
            }

            throw new NotImplementedException($"ProjectName {projectName} has not been implemented.");
        }
示例#7
0
 public OptionComboItem(string name, SupportedFramework sfx)
 {
     this.Name      = name;
     this.Framework = sfx;
     this.Targets   = new List <TargetFramework> ();
 }