Пример #1
0
        // TODO: [InlineData ("MacProject", Platform.MacOS, null)] not implemented yet
        public void GetProjectPath(string projectName, Platform platform, string expectedName)
        {
            // ignore the fact that all params are the same, we do not care
            var generator = new BCLTestProjectGenerator(outputdir, outputdir, outputdir, outputdir, outputdir);
            var path      = generator.GetProjectPath(projectName, platform);

            Assert.AreEqual(Path.Combine(generator.OutputDirectoryPath, expectedName), path);
        }
Пример #2
0
        public void GetProjectPathWatchOS(string projectName, BCLTestProjectGenerator.WatchAppType appType, string expectedName)
        {
            // ignore the fact that all params are the same, we do not care
            var generator = new BCLTestProjectGenerator(outputdir, outputdir, outputdir, outputdir, outputdir);
            var path      = generator.GetProjectPath(projectName, appType);

            Assert.Equal(Path.Combine(generator.OutputDirectoryPath, expectedName), path);
        }
Пример #3
0
        public void GenerateWatchProject(string projectName, string plistPath)
        {
            var generator        = new BCLTestProjectGenerator(outputdir, outputdir, outputdir, outputdir, outputdir);
            var template         = $"{BCLTestProjectGenerator.NameKey} {BCLTestProjectGenerator.WatchOSTemplatePathKey} {BCLTestProjectGenerator.PlistKey} {BCLTestProjectGenerator.WatchOSCsporjAppKey}";
            var generatedProject = generator.GenerateWatchProject(projectName, template, plistPath);

            Assert.DoesNotContain(BCLTestProjectGenerator.NameKey, generatedProject);
            Assert.Contains(projectName, generatedProject);
            Assert.DoesNotContain(BCLTestProjectGenerator.WatchOSTemplatePathKey, generatedProject);
            Assert.DoesNotContain(BCLTestProjectGenerator.PlistKey, generatedProject);
            Assert.Contains(plistPath, generatedProject);
        }
Пример #4
0
        public void GetRegisterTypeNode(string registerPath)
        {
            var fixedPath = registerPath.Replace("/", "\\");
            var sb        = new StringBuilder();

            sb.AppendLine($"<Compile Include=\"{registerPath}\">");
            sb.AppendLine($"<Link>{Path.GetFileName (registerPath)}</Link>");
            sb.AppendLine("</Compile>");
            var expected = sb.ToString();

            Assert.Equal(expected, BCLTestProjectGenerator.GetRegisterTypeNode(registerPath));
        }
Пример #5
0
        public void GetReferenceNode(string assembly, string hint)
        {
            var fixedHint = hint.Replace("/", "\\");
            var sb        = new StringBuilder();

            sb.AppendLine($"<Reference Include=\"{assembly}\" >");
            sb.AppendLine($"<HintPath>{fixedHint}</HintPath>");
            sb.AppendLine("</Reference>");
            var expected = sb.ToString();

            Assert.Equal(expected, BCLTestProjectGenerator.GetReferenceNode(assembly, hint));
        }
        public BCLTestImportTargetFactory(Harness harness)
        {
            Harness = harness;
            var outputDir                 = Path.GetFullPath(Path.Combine(Harness.RootDirectory, "bcl-test", "BCLTests"));
            var projectTemplatePath       = outputDir;
            var registerTypesTemplatePath = Path.Combine(outputDir, "RegisterType.cs.in");
            var plistTemplatePath         = outputDir;

            projectGenerator = new BCLTestProjectGenerator(outputDir, Harness.MONO_PATH, projectTemplatePath, registerTypesTemplatePath, plistTemplatePath)
            {
                Override = true
            };
        }
Пример #7
0
        public BCLTestImportTargetFactory(Harness harness)
        {
            Harness = harness;
            var outputDir                 = Path.GetFullPath(Path.Combine(Harness.RootDirectory, "bcl-test", "BCLTests"));
            var projectTemplatePath       = outputDir;
            var registerTypesTemplatePath = Path.Combine(outputDir, "RegisterType.cs.in");
            var plistTemplatePath         = outputDir;

            projectGenerator = new BCLTestProjectGenerator(outputDir, Harness.MONO_PATH, projectTemplatePath, registerTypesTemplatePath, plistTemplatePath)
            {
                iOSMonoSDKPath = Harness.MONO_SDK_DESTDIR,
                Override       = true,
                GuidGenerator  = Harness.NewStableGuid,
                GroupTests     = Harness.InJenkins || Harness.UseGroupedApps,
            };
        }
Пример #8
0
        public void GetReferenceNodeNullHint(string assembly)
        {
            var expected = $"<Reference Include=\"{assembly}\" />";

            Assert.Equal(expected, BCLTestProjectGenerator.GetReferenceNode(assembly));
        }
Пример #9
0
        public void GetPListPathWatchOS(string rootDir, BCLTestProjectGenerator.WatchAppType appType, string expectedName)
        {
            var path = BCLTestProjectGenerator.GetPListPath(rootDir, appType);

            Assert.Equal(Path.Combine(rootDir, expectedName), path);
        }
Пример #10
0
        // TODO: [InlineData ("/usr/mac/path", Platform.MacOS)] not implemented yet
        public void GetPListPath(string rootDir, Platform platform, string expectedName)
        {
            var path = BCLTestProjectGenerator.GetPListPath(rootDir, platform);

            Assert.Equal(Path.Combine(rootDir, expectedName), path);
        }