diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2020-01-08 13:53:48 +0200 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2020-01-08 13:53:48 +0200 |
| commit | 5a06b997b7ef29c566bad2bc65f927e9443c3888 (patch) | |
| tree | 7c332325fc01f82b68855bf31636830085ba6954 /Software/Visual_Studio/Tango.UnitTesting | |
| parent | 7f05564656644b9af0500657a689c12805aee732 (diff) | |
| download | Tango-5a06b997b7ef29c566bad2bc65f927e9443c3888.tar.gz Tango-5a06b997b7ef29c566bad2bc65f927e9443c3888.zip | |
Implemented maintenance mid-tank graphics.
Implemented session file logger.
Diffstat (limited to 'Software/Visual_Studio/Tango.UnitTesting')
| -rw-r--r-- | Software/Visual_Studio/Tango.UnitTesting/Logging/SessionLoging_TST.cs | 38 | ||||
| -rw-r--r-- | Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj | 3 |
2 files changed, 40 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.UnitTesting/Logging/SessionLoging_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/Logging/SessionLoging_TST.cs new file mode 100644 index 000000000..873fcca57 --- /dev/null +++ b/Software/Visual_Studio/Tango.UnitTesting/Logging/SessionLoging_TST.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Tango.Logging; + +namespace Tango.UnitTesting.Logging +{ + [TestClass] + [TestCategory("Logging")] + public class SessionLoging_TST + { + [TestMethod] + public void Create_Session_File_Logger() + { + SessionFileLogger sessionlogger = new SessionFileLogger(); + LogManager.Default.RegisterLogger(sessionlogger); + sessionlogger.CreateSession(); + var manager = LogManager.Default; + + manager.Log($"This is a test 1"); + Thread.Sleep(300); + SessionFileLogger slogger = LogManager.Default.RegisteredLoggers.FirstOrDefault(x => x.GetType() == typeof(SessionFileLogger)) as SessionFileLogger; + string[] fileEntries = Directory.GetFiles(slogger.Folder, "*.log"); + Assert.AreEqual(1, fileEntries.Count()); + + sessionlogger.CreateSession(); + manager.Log($"This is a test 2"); + Thread.Sleep(300); + fileEntries = Directory.GetFiles(slogger.Folder, "*.log"); + Assert.AreEqual(1, fileEntries.Count()); + } + } +} diff --git a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj index 05daac6c7..01e639a75 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj +++ b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj @@ -140,6 +140,7 @@ <Compile Include="BL\HardwareConfiguration_TST.cs" /> <Compile Include="Integration\JobDescriptionFile_TST.cs" /> <Compile Include="Logging\Parsing_TST.cs" /> + <Compile Include="Logging\SessionLoging_TST.cs" /> <Compile Include="MachineService\PPC_Controller_TST.cs" /> <Compile Include="MachineStudio\MachineStudio_TST.cs" /> <Compile Include="Pulse\Pulse_TST.cs" /> @@ -309,7 +310,7 @@ <Import Project="..\packages\System.Data.SQLite.Core.1.0.108.0\build\net46\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.108.0\build\net46\System.Data.SQLite.Core.targets')" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> + <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file |
