public void TearDown() { if (Directory.Exists(outputdir)) { Directory.Delete(outputdir, true); } outputdir = null; assemlyLocator = null; projectFilter = null; template = null; }
public void GetRegisterTypeNodeTest(string registerPath) { 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, XamariniOSTemplate.GetRegisterTypeNode(registerPath)); }
public void GetReferenceNodeTest(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.AreEqual(expected, XamariniOSTemplate.GetReferenceNode(assembly, hint)); }
public void SetUp() { outputdir = Path.GetTempFileName(); File.Delete(outputdir); Directory.CreateDirectory(outputdir); assemlyLocator = new Mock <IAssemblyLocator> (); projectFilter = new Mock <IProjectFilter> (); template = new XamariniOSTemplate { AssemblyLocator = assemlyLocator.Object, ProjectFilter = projectFilter.Object, OutputDirectoryPath = outputdir, }; }
public void GetContentNodeTest(string contentFile) { var fixedPath = contentFile.Replace("/", "\\"); var sb = new StringBuilder(); sb.AppendLine($"<Content Include=\"{fixedPath}\">"); sb.AppendLine($"<Link>{Path.GetFileName (contentFile)}</Link>"); sb.AppendLine("<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>"); sb.AppendLine("</Content>"); var expected = sb.ToString(); Assert.AreEqual(expected, XamariniOSTemplate.GetContentNode(contentFile)); }
public XamariniOSTemplateTest() { _outputdir = Path.GetTempFileName(); File.Delete(_outputdir); Directory.CreateDirectory(_outputdir); _assemlyLocator = new Mock <IAssemblyLocator>(); _projectFilter = new Mock <IProjectFilter>(); _template = new XamariniOSTemplate { AssemblyLocator = _assemlyLocator.Object, ProjectFilter = _projectFilter.Object, OutputDirectoryPath = _outputdir, }; }
public void GetReferenceNodeNullHintTest(string assembly) { var expected = $"<Reference Include=\"{assembly}\" />"; Assert.AreEqual(expected, XamariniOSTemplate.GetReferenceNode(assembly)); }
public void GetPListPathWatchOSTest(string rootDir, WatchAppType appType, string expectedName) { var path = XamariniOSTemplate.GetPListPath(rootDir, appType); Assert.AreEqual(Path.Combine(rootDir, expectedName), path); }
public void GetPListPathTest(string rootDir, Platform platform, string expectedName) { var path = XamariniOSTemplate.GetPListPath(rootDir, platform); Assert.AreEqual(Path.Combine(rootDir, expectedName), path); }