aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.UnitTesting
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-05-09 18:07:56 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-05-09 18:07:56 +0300
commite1236499b485a69648bea4d7871aa185e5dae745 (patch)
tree8cd4ccd7d272c8c4e61d4bd6bcba434eb9522b85 /Software/Visual_Studio/Tango.UnitTesting
parent2a459c79e90a2ade3f1dac1ae4541c0f4d74965c (diff)
downloadTango-e1236499b485a69648bea4d7871aa185e5dae745.tar.gz
Tango-e1236499b485a69648bea4d7871aa185e5dae745.zip
New TemporaryManager !
Diffstat (limited to 'Software/Visual_Studio/Tango.UnitTesting')
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/TFS_TST.cs7
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj1
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/Temporary_TST.cs34
3 files changed, 39 insertions, 3 deletions
diff --git a/Software/Visual_Studio/Tango.UnitTesting/TFS_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/TFS_TST.cs
index 3fff8daae..47984792a 100644
--- a/Software/Visual_Studio/Tango.UnitTesting/TFS_TST.cs
+++ b/Software/Visual_Studio/Tango.UnitTesting/TFS_TST.cs
@@ -6,6 +6,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.Core.Helpers;
+using Tango.Core.IO;
using Tango.TFS;
namespace Tango.UnitTesting
@@ -114,13 +115,13 @@ namespace Tango.UnitTesting
item.ChangedBy = project.Members.Single(x => x.DisplayName.Contains("Shlomo"));
item.AuthorizedAs = project.Members.Single(x => x.DisplayName.Contains("Shlomo"));
- String tempFile = PathHelper.GetTempFilePath();
- File.AppendAllText(tempFile, "This is a test text file...");
+ var tempFile = TemporaryManager.Default.CreateFile();
+ File.AppendAllText(tempFile.Path, "This is a test text file...");
item.Attachments.Add(new Attachment()
{
Description = "Test Attachment",
- FilePath = tempFile,
+ FilePath = tempFile.Path,
Name = "TestDocument.txt"
});
diff --git a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj
index fd7de86c4..71a9413c2 100644
--- a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj
+++ b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj
@@ -89,6 +89,7 @@
<Compile Include="DependencyInjection_TST.cs" />
<Compile Include="Logging_TST.cs" />
<Compile Include="MachineStudio_TST.cs" />
+ <Compile Include="Temporary_TST.cs" />
<Compile Include="TFS_TST.cs" />
<Compile Include="Outlook_TST.cs" />
<Compile Include="Scripting_TST.cs" />
diff --git a/Software/Visual_Studio/Tango.UnitTesting/Temporary_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/Temporary_TST.cs
new file mode 100644
index 000000000..6e9d7eeb7
--- /dev/null
+++ b/Software/Visual_Studio/Tango.UnitTesting/Temporary_TST.cs
@@ -0,0 +1,34 @@
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using Tango.Core.IO;
+
+namespace Tango.UnitTesting
+{
+ [TestClass]
+ [TestCategory("Temporary Files & Folders")]
+ public class Temporary_TST
+ {
+ [TestMethod]
+ public void Create_Temporary_Folder_And_Files_Display_And_Delete()
+ {
+ TemporaryManager manager = TemporaryManager.Default;
+
+ var folder = manager.CreateFolder();
+
+ folder.Display();
+
+ Thread.Sleep(1000);
+
+ for (int i = 0; i < 10; i++)
+ {
+ var file = folder.CreateFile();
+ Thread.Sleep(1000);
+ }
+ }
+ }
+}