mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-08-17 00:31:42 +02:00
Configuration
Core
Data
Plugins
Properties
Resources
Updates
bld
lib
TweetLib.Communication
TweetTest.System
Configuration
Data
Properties
TweetTest.System.csproj
UnitTestIO.cs
packages.config
TweetTest.Unit
subprocess
video
.gitattributes
.gitignore
LICENSE.md
Program.cs
README.md
Reporter.cs
TweetDuck.csproj
TweetDuck.sln
TweetDuck.sln.DotSettings
packages.config
33 lines
1020 B
C#
33 lines
1020 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
|
|
namespace TweetTest{
|
|
[TestClass]
|
|
public class TestIO{
|
|
private static readonly HashSet<string> CreatedFolders = new HashSet<string>();
|
|
|
|
[TestInitialize]
|
|
public void InitTest(){
|
|
string folder = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, GetType().Name);
|
|
CreatedFolders.Add(folder);
|
|
Directory.CreateDirectory(folder);
|
|
Directory.SetCurrentDirectory(folder);
|
|
}
|
|
|
|
[AssemblyCleanup]
|
|
public static void DeleteFilesOnExit(){
|
|
Directory.SetCurrentDirectory(AppDomain.CurrentDomain.SetupInformation.ApplicationBase);
|
|
|
|
foreach(string folder in CreatedFolders){
|
|
try{
|
|
Directory.Delete(folder, true);
|
|
}catch(Exception){
|
|
// ignore
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|