public void ResolveAssemblyReferenceWithNull() { // fields string path = Directory.GetCurrentDirectory(); string fileName = null; string fileContentResult = string.Empty; // Create the Host ITextTemplatingEngineHost host = new TemplateHost(path, new Dictionary <string, PropertyData>()); fileContentResult = host.ResolveAssemblyReference(fileName); }
public void ResolveAssemblyNotExistsBinPathExistsCurrDir() { if (Directory.Exists("Temp")) { Directory.Delete("Temp", true); } Directory.CreateDirectory("Temp"); string asmName = this.GetType().Module.Name; ITextTemplatingEngineHost host = new TemplateHost( "Temp", new Dictionary <string, PropertyData>()); string result = host.ResolveAssemblyReference(asmName); Assert.AreEqual(asmName, result, "Resolution did not resolve to the dll in the base directory."); Directory.Delete("Temp", true); }
public void ResolveAssemblyExistsBinPath() { if (Directory.Exists("Temp")) { Directory.Delete("Temp", true); } Directory.CreateDirectory("Temp"); File.Copy(new Uri(this.GetType().Assembly.CodeBase).LocalPath, "Temp\\Test.dll"); ITextTemplatingEngineHost host = new TemplateHost( "Temp", new Dictionary <string, PropertyData>()); string result = host.ResolveAssemblyReference("Test.dll"); Assert.AreEqual(new FileInfo("Temp\\Test.dll").FullName, result, "Resolution did not include bin path even if the file existed."); Directory.Delete("Temp", true); }