private void Initialize(string assemblyPath, IDictionary settings) { AssemblyNameOrPath = assemblyPath; Settings = settings; if (settings.Contains(PackageSettings.InternalTraceLevel)) { var traceLevel = (InternalTraceLevel)Enum.Parse(typeof(InternalTraceLevel), (string)settings[PackageSettings.InternalTraceLevel], true); if (settings.Contains(PackageSettings.InternalTraceWriter)) { InternalTrace.Initialize((TextWriter)settings[PackageSettings.InternalTraceWriter], traceLevel); } #if !PORTABLE && !SILVERLIGHT else { var workDirectory = settings.Contains(PackageSettings.WorkDirectory) ? (string)settings[PackageSettings.WorkDirectory] : Env.DefaultWorkDirectory; var logName = string.Format(LOG_FILE_FORMAT, Process.GetCurrentProcess().Id, Path.GetFileName(assemblyPath)); InternalTrace.Initialize(Path.Combine(workDirectory, logName), traceLevel); } #endif } }
/// <summary> /// Initializes a new instance of the <see cref="TestAssembly"/> class /// for a path which could not be loaded. /// </summary> /// <param name="path">The path used to load the assembly.</param> public TestAssembly(string path) : base(path) { this.Name = Path.GetFileName(path); }
/// <summary> /// Initializes a new instance of the <see cref="TestAssembly"/> class /// specifying the Assembly and the path from which it was loaded. /// </summary> /// <param name="assembly">The assembly this test represents.</param> /// <param name="path">The path used to load the assembly.</param> public TestAssembly(Assembly assembly, string path) : base(path) { this.Assembly = assembly; this.Name = Path.GetFileName(path); }