Exemplo n.º 1
0
        public void ReferenceFrameworkFileResolution_WhenFrameworkFileExists(string targetFramework, string frameworkDir)
        {
            using (var sdk = new TempSdk()) {
                Task.TargetFrameworkIdentifier = targetFramework;
                var expectedPath = Path.Combine(IPhoneSdks.MonoTouch.LibDir, "mono", frameworkDir, "System.Collections.dll");
                Directory.CreateDirectory(Path.GetDirectoryName(expectedPath));
                File.WriteAllText(expectedPath, "");

                Task.References = new[] { new TaskItem("System.Collections.dll", new Dictionary <string, string> {
                        { "FrameworkFile", "true" }
                    }) };

                var args = Task.GenerateCommandLineCommands();

                if (Environment.OSVersion.Platform == PlatformID.Win32NT)
                {
                    // In Windows, the path slashes are escaped.
                    expectedPath = expectedPath.Replace("\\", "\\\\");
                }

                Assert.IsTrue(Task.ResponseFile.Contains(expectedPath), string.Format(
                                  @"Failed to resolve facade assembly to the Sdk path.
	Expected path:{0}

	Actual args:{1}"    , expectedPath, Task.ResponseFile));
            }
        }
Exemplo n.º 2
0
        public void ReferenceFrameworkFileResolution_WhenResolutionFails(string targetFramework, string frameworkDir)
        {
            using (var sdk = new TempSdk()) {
                Task.TargetFrameworkIdentifier = targetFramework;

                Task.References = new[] { new TaskItem("/usr/foo/System.Collections.dll", new Dictionary <string, string> {
                        { "FrameworkFile", "true" }
                    }) };

                var args = Task.GenerateCommandLineCommands();

                Assert.IsTrue(Task.ResponseFile.Contains("/usr/foo/System.Collections.dll"));
            }
        }
Exemplo n.º 3
0
        public void ReferenceFrameworkFileResolution_WhenReceivedReferencePathExists()
        {
            using (var sdk = new TempSdk()) {
                Task.TargetFrameworkIdentifier = "MonoTouch";

                var expectedPath = Path.GetTempFileName();

                Task.References = new[] { new TaskItem(expectedPath, new Dictionary <string, string> {
                        { "FrameworkFile", "true" }
                    }) };

                var args = Task.GenerateCommandLineCommands();

                if (Environment.OSVersion.Platform == PlatformID.Win32NT)
                {
                    // In Windows, the path slashes are escaped.
                    expectedPath = expectedPath.Replace("\\", "\\\\");
                }

                Assert.IsTrue(Task.ResponseFile.Contains(expectedPath));
            }
        }
Exemplo n.º 4
0
        public void ReferenceFrameworkFileResolution_WhenFrameworkFileExists(string targetFramework, string frameworkDir)
        {
            using (var sdk = new TempSdk()) {
                Task.TargetFrameworkIdentifier = targetFramework;
                var expectedPath = Path.Combine (IPhoneSdks.MonoTouch.LibDir, "mono", frameworkDir, "System.Collections.dll");
                Directory.CreateDirectory (Path.GetDirectoryName (expectedPath));
                File.WriteAllText (expectedPath, "");

                Task.References = new[] { new TaskItem ("System.Collections.dll", new Dictionary<string, string> { { "FrameworkFile", "true" } }) };

                var args = Task.GenerateCommandLineCommands ();

                if (Environment.OSVersion.Platform == PlatformID.Win32NT)
                    // In Windows, the path slashes are escaped.
                    expectedPath = expectedPath.Replace ("\\", "\\\\");

                Assert.IsTrue (args.Contains (expectedPath), string.Format(
                    @"Failed to resolve facade assembly to the Sdk path.
            Expected path:{0}

            Actual args:{1}", expectedPath, args));
            }
        }
Exemplo n.º 5
0
        public void ReferenceFrameworkFileResolution_WhenResolutionFails(string targetFramework, string frameworkDir)
        {
            using (var sdk = new TempSdk()) {
                Task.TargetFrameworkIdentifier = targetFramework;

                Task.References = new[] { new TaskItem ("/usr/foo/System.Collections.dll", new Dictionary<string, string> { { "FrameworkFile", "true" } }) };

                var args = Task.GenerateCommandLineCommands ();

                Assert.IsTrue (args.Contains ("/usr/foo/System.Collections.dll"));
            }
        }
Exemplo n.º 6
0
        public void ReferenceFrameworkFileResolution_WhenReceivedReferencePathExists()
        {
            using (var sdk = new TempSdk()) {
                Task.TargetFrameworkIdentifier = "MonoTouch";

                var expectedPath = Path.GetTempFileName ();

                Task.References = new[] { new TaskItem (expectedPath, new Dictionary<string, string> { { "FrameworkFile", "true" } }) };

                var args = Task.GenerateCommandLineCommands ();

                if (Environment.OSVersion.Platform == PlatformID.Win32NT)
                    // In Windows, the path slashes are escaped.
                    expectedPath = expectedPath.Replace ("\\", "\\\\");

                Assert.IsTrue (args.Contains (expectedPath));
            }
        }