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)); } }
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")); } }
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)); } }
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)); } }
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")); } }
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)); } }