コード例 #1
0
        private TestHostContext Initialize([CallerMemberName] string name = "", bool createWorkDirectory = true)
        {
            var hostContext = new TestHostContext(this, name);

            this.stubWorkFolder = hostContext.GetDirectory(WellKnownDirectory.Work);
            if (createWorkDirectory)
            {
                Directory.CreateDirectory(this.stubWorkFolder);
            }

            this.releaseDirectoryManager = new ReleaseDirectoryManager();
            this.releaseDirectoryManager.Initialize(hostContext);

            return(hostContext);
        }
コード例 #2
0
        private TestHostContext Initialize([CallerMemberName] string name = "", bool createWorkDirectory = true)
        {
            this.stubWorkFolder = Path.Combine(
                Path.GetDirectoryName(Assembly.GetEntryAssembly().Location),
                $"_work_{Path.GetRandomFileName()}");
            if (createWorkDirectory)
            {
                Directory.CreateDirectory(this.stubWorkFolder);
            }

            var hostContext = new TestHostContext(this, name);

            this.releaseDirectoryManager = new ReleaseDirectoryManager();
            this.releaseDirectoryManager.Initialize(hostContext);

            return(hostContext);
        }