diff --git a/Agent/AmagnoVirtualPrinter.Delivery/GhostScriptRedirector.cs b/Agent/AmagnoVirtualPrinter.Delivery/GhostScriptRedirector.cs
index d369e71..39d479f 100644
--- a/Agent/AmagnoVirtualPrinter.Delivery/GhostScriptRedirector.cs
+++ b/Agent/AmagnoVirtualPrinter.Delivery/GhostScriptRedirector.cs
@@ -45,6 +45,7 @@ namespace AmagnoVirtualPrinter.Delivery
if (ghostScriptExe == null)
{
+ logger.Error("Can not find Ghostscript.");
throw new FileNotFoundException("Can not find Ghostscript.");
}
diff --git a/AmagnoVirtualPrinter.sln b/AmagnoVirtualPrinter.sln
index 1eea451..6ab1a7a 100644
--- a/AmagnoVirtualPrinter.sln
+++ b/AmagnoVirtualPrinter.sln
@@ -40,6 +40,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Installer", "Installer", "{
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{95284260-12AD-4C69-BF4B-6B3A7BA5627C}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{CD57AFC1-AD22-4A86-A9D9-26D2074BF75D}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AmagnoVirtualPrinter.Utils.UnitTests", "Tests\AmagnoVirtualPrinter.Utils.UnitTests\AmagnoVirtualPrinter.Utils.UnitTests.csproj", "{2349BD8A-03E5-4226-B3C6-56C2F718B7CB}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AmagnoVirtualPrinter.Agent.Lib.Tests", "Tests\AmagnoVirtualPrinter.Agent.Lib.Tests\AmagnoVirtualPrinter.Agent.Lib.Tests.csproj", "{36CD25FD-B1E2-4C87-970F-A40CCC961390}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -218,6 +224,30 @@ Global
{CD1C8E9D-5335-41AC-B0C0-88FD7C7C55F3}.Release|x64.Build.0 = Release|Any CPU
{CD1C8E9D-5335-41AC-B0C0-88FD7C7C55F3}.Release|x86.ActiveCfg = Release|Any CPU
{CD1C8E9D-5335-41AC-B0C0-88FD7C7C55F3}.Release|x86.Build.0 = Release|Any CPU
+ {2349BD8A-03E5-4226-B3C6-56C2F718B7CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {2349BD8A-03E5-4226-B3C6-56C2F718B7CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {2349BD8A-03E5-4226-B3C6-56C2F718B7CB}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {2349BD8A-03E5-4226-B3C6-56C2F718B7CB}.Debug|x64.Build.0 = Debug|Any CPU
+ {2349BD8A-03E5-4226-B3C6-56C2F718B7CB}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {2349BD8A-03E5-4226-B3C6-56C2F718B7CB}.Debug|x86.Build.0 = Debug|Any CPU
+ {2349BD8A-03E5-4226-B3C6-56C2F718B7CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {2349BD8A-03E5-4226-B3C6-56C2F718B7CB}.Release|Any CPU.Build.0 = Release|Any CPU
+ {2349BD8A-03E5-4226-B3C6-56C2F718B7CB}.Release|x64.ActiveCfg = Release|Any CPU
+ {2349BD8A-03E5-4226-B3C6-56C2F718B7CB}.Release|x64.Build.0 = Release|Any CPU
+ {2349BD8A-03E5-4226-B3C6-56C2F718B7CB}.Release|x86.ActiveCfg = Release|Any CPU
+ {2349BD8A-03E5-4226-B3C6-56C2F718B7CB}.Release|x86.Build.0 = Release|Any CPU
+ {36CD25FD-B1E2-4C87-970F-A40CCC961390}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {36CD25FD-B1E2-4C87-970F-A40CCC961390}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {36CD25FD-B1E2-4C87-970F-A40CCC961390}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {36CD25FD-B1E2-4C87-970F-A40CCC961390}.Debug|x64.Build.0 = Debug|Any CPU
+ {36CD25FD-B1E2-4C87-970F-A40CCC961390}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {36CD25FD-B1E2-4C87-970F-A40CCC961390}.Debug|x86.Build.0 = Debug|Any CPU
+ {36CD25FD-B1E2-4C87-970F-A40CCC961390}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {36CD25FD-B1E2-4C87-970F-A40CCC961390}.Release|Any CPU.Build.0 = Release|Any CPU
+ {36CD25FD-B1E2-4C87-970F-A40CCC961390}.Release|x64.ActiveCfg = Release|Any CPU
+ {36CD25FD-B1E2-4C87-970F-A40CCC961390}.Release|x64.Build.0 = Release|Any CPU
+ {36CD25FD-B1E2-4C87-970F-A40CCC961390}.Release|x86.ActiveCfg = Release|Any CPU
+ {36CD25FD-B1E2-4C87-970F-A40CCC961390}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -237,6 +267,8 @@ Global
{A668846E-54C7-483D-9CF7-48F77EA398CA} = {5EE0067B-1ED5-44FB-941D-8F4B039FDD2E}
{AA25364D-22D5-44B0-86A5-6FB14C686308} = {95284260-12AD-4C69-BF4B-6B3A7BA5627C}
{CD1C8E9D-5335-41AC-B0C0-88FD7C7C55F3} = {95284260-12AD-4C69-BF4B-6B3A7BA5627C}
+ {2349BD8A-03E5-4226-B3C6-56C2F718B7CB} = {CD57AFC1-AD22-4A86-A9D9-26D2074BF75D}
+ {36CD25FD-B1E2-4C87-970F-A40CCC961390} = {CD57AFC1-AD22-4A86-A9D9-26D2074BF75D}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {52642DB4-40BC-4C37-880C-73F24AE287ED}
diff --git a/Common/AmagnoVirtualPrinter.Agent.Core/Model/SessionInfo.cs b/Common/AmagnoVirtualPrinter.Agent.Core/Model/SessionInfo.cs
index 99a369b..38a448d 100644
--- a/Common/AmagnoVirtualPrinter.Agent.Core/Model/SessionInfo.cs
+++ b/Common/AmagnoVirtualPrinter.Agent.Core/Model/SessionInfo.cs
@@ -2,12 +2,14 @@
namespace AmagnoVirtualPrinter.Agent.Core.Model
{
- public struct SessionInfo : ISessionInfo
+ public class SessionInfo : ISessionInfo
{
public int Id { get; set; }
public string Desktop { get; set; }
public string Sid { get; set; }
+
+ public bool FoundDomain { get; set; }
}
}
\ No newline at end of file
diff --git a/Common/AmagnoVirtualPrinter.Agent.Lib/AmagnoVirtualPrinter.Agent.Lib.csproj b/Common/AmagnoVirtualPrinter.Agent.Lib/AmagnoVirtualPrinter.Agent.Lib.csproj
index e52c0d5..17dad6b 100644
--- a/Common/AmagnoVirtualPrinter.Agent.Lib/AmagnoVirtualPrinter.Agent.Lib.csproj
+++ b/Common/AmagnoVirtualPrinter.Agent.Lib/AmagnoVirtualPrinter.Agent.Lib.csproj
@@ -41,6 +41,7 @@
+
diff --git a/Common/AmagnoVirtualPrinter.Agent.Lib/Misc/GhostScriptConverter.cs b/Common/AmagnoVirtualPrinter.Agent.Lib/Misc/GhostScriptConverter.cs
index 854d209..ce31d09 100644
--- a/Common/AmagnoVirtualPrinter.Agent.Lib/Misc/GhostScriptConverter.cs
+++ b/Common/AmagnoVirtualPrinter.Agent.Lib/Misc/GhostScriptConverter.cs
@@ -62,6 +62,7 @@ namespace AmagnoVirtualPrinter.Agent.Lib.Misc
if (ghostScriptExe == null)
{
+ _logger.Error("GhostScript not found.");
throw new PostScriptConversionException("GhostScript not found. Please place local variable.");
}
diff --git a/Common/AmagnoVirtualPrinter.Agent.Lib/Misc/JobFactory.cs b/Common/AmagnoVirtualPrinter.Agent.Lib/Misc/JobFactory.cs
index cd748c3..f2938d8 100644
--- a/Common/AmagnoVirtualPrinter.Agent.Lib/Misc/JobFactory.cs
+++ b/Common/AmagnoVirtualPrinter.Agent.Lib/Misc/JobFactory.cs
@@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
-using System.Printing;
using System.Security.Principal;
using AmagnoVirtualPrinter.Agent.Core.Enums;
using AmagnoVirtualPrinter.Agent.Core.Interfaces;
@@ -67,13 +66,15 @@ namespace AmagnoVirtualPrinter.Agent.Lib.Misc
{
var now = DateTime.Now;
- var jobInfo = GetCurrentPrintJobs(printerName).FirstOrDefault();
+ var jobInfo = PrintJobReader.GetCurrentPrintJobs(printerName).FirstOrDefault();
if (jobInfo == null)
{
throw new InvalidOperationException();
}
- var session = GetCurrentSessions(jobInfo).FirstOrDefault();
+ var sessions = GetCurrentSessions(jobInfo).ToArray();
+ var session = sessions.FirstOrDefault(s => s.FoundDomain) ?? sessions.FirstOrDefault();
+
var config = _registryRepository.GetRegistryConfig();
var userConfig = _registryRepository.GetUserRegistryConfig(session.Sid);
var root = _directoryHelper.GetOutputDirectory(userConfig);
@@ -144,11 +145,11 @@ namespace AmagnoVirtualPrinter.Agent.Lib.Misc
{
var domain = job.DomainName;
var machine = job.MachineName?.TrimStart('\\');
- var user = job.UserName;
+ var username = job.UserName;
- LogDebug($"Searching for session of {domain}\\{user} on {machine} !");
+ LogDebug($"Searching for session of {domain}\\{username} on {machine} !");
- if (domain == null || machine == null || user == null)
+ if (domain == null || machine == null || username == null)
{
yield break;
}
@@ -159,7 +160,7 @@ namespace AmagnoVirtualPrinter.Agent.Lib.Misc
var sessions = server.GetSessions().Where(s => s.UserName != null && s.DomainName != null);
foreach (var session in sessions)
{
- if (!session.UserName.Equals(user, cmp))
+ if (!session.UserName.Equals(username, cmp))
{
continue;
}
@@ -168,7 +169,7 @@ namespace AmagnoVirtualPrinter.Agent.Lib.Misc
var isDomainUser = session.DomainName.Equals(domain, cmp);
if (!isSingleUser && !isDomainUser)
{
- continue;
+ LogWarn("Found Session {sessionId} for {username} but its not of domain {domain} or {machine}", session.SessionId, username, domain, machine);
}
var sessionId = session.SessionId;
@@ -178,47 +179,13 @@ namespace AmagnoVirtualPrinter.Agent.Lib.Misc
{
Id = sessionId,
Desktop = desktopName,
- Sid = account.Translate(typeof(SecurityIdentifier)).Value
+ Sid = account.Translate(typeof(SecurityIdentifier)).Value,
+ FoundDomain = isSingleUser || isDomainUser
};
}
}
}
- [ItemNotNull]
- private IEnumerable GetCurrentPrintJobs(string printerName)
- {
- using (var server = new LocalPrintServer())
- {
- using (var queue = server.GetPrintQueue(printerName))
- {
- using (var jobs = queue.GetPrintJobInfoCollection())
- {
- foreach (var job in jobs)
- {
- using (job)
- {
- var id = job.JobIdentifier;
- var machine = server.Name;
- var domain = Environment.UserDomainName;
- var user = job.Submitter;
- var name = job.Name;
- yield return new JobInfo
- {
- JobId = id,
- Name = name,
- DomainName = domain,
- MachineName = machine,
- UserName = user,
- Status = job.JobStatus,
- DeviceName = queue.Name
- };
- }
- }
- }
- }
- }
- }
-
[NotNull]
private string GetRawFileExtension(IntermediateFormat format)
{
@@ -242,5 +209,10 @@ namespace AmagnoVirtualPrinter.Agent.Lib.Misc
{
_logger.Error(exception, message, args);
}
+
+ private void LogWarn(string message, params object[] args)
+ {
+ _logger.Warn(message, args);
+ }
}
}
diff --git a/Common/AmagnoVirtualPrinter.Agent.Lib/Misc/PrintJobReader.cs b/Common/AmagnoVirtualPrinter.Agent.Lib/Misc/PrintJobReader.cs
new file mode 100644
index 0000000..7a285c1
--- /dev/null
+++ b/Common/AmagnoVirtualPrinter.Agent.Lib/Misc/PrintJobReader.cs
@@ -0,0 +1,47 @@
+using System;
+using System.Collections.Generic;
+using System.Printing;
+using AmagnoVirtualPrinter.Agent.Core.Interfaces;
+using AmagnoVirtualPrinter.Agent.Core.Model;
+using JetBrains.Annotations;
+
+namespace AmagnoVirtualPrinter.Agent.Lib.Misc
+{
+ public class PrintJobReader
+ {
+ [ItemNotNull]
+ public static IEnumerable GetCurrentPrintJobs(string printerName)
+ {
+ using (var server = new LocalPrintServer())
+ {
+ using (var queue = server.GetPrintQueue(printerName))
+ {
+ using (var jobs = queue.GetPrintJobInfoCollection())
+ {
+ foreach (var job in jobs)
+ {
+ using (job)
+ {
+ var id = job.JobIdentifier;
+ var machine = server.Name;
+ var domain = Environment.UserDomainName;
+ var user = job.Submitter;
+ var name = job.Name;
+ yield return new JobInfo
+ {
+ JobId = id,
+ Name = name,
+ DomainName = domain,
+ MachineName = machine,
+ UserName = user,
+ Status = job.JobStatus,
+ DeviceName = queue.Name
+ };
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Common/AmagnoVirtualPrinter.Utils/RegistryRepository.cs b/Common/AmagnoVirtualPrinter.Utils/RegistryRepository.cs
index 6de34b7..bed3fed 100644
--- a/Common/AmagnoVirtualPrinter.Utils/RegistryRepository.cs
+++ b/Common/AmagnoVirtualPrinter.Utils/RegistryRepository.cs
@@ -4,6 +4,7 @@ using System.Linq;
using AmagnoVirtualPrinter.Agent.Core.Enums;
using AmagnoVirtualPrinter.Agent.Core.Interfaces;
using AmagnoVirtualPrinter.Agent.Core.Model;
+using AmagnoVirtualPrinter.Logging;
using JetBrains.Annotations;
using Microsoft.Win32;
@@ -13,6 +14,8 @@ namespace AmagnoVirtualPrinter.Utils
public class RegistryRepository : IRegistryRepository
{
private const short DefaultServerPort = 9101;
+
+ private static readonly IVirtualPrinterLogger Logger = new VirtualPrinterLogger();
public bool TryGetGhostscriptPath(out string path)
{
@@ -104,6 +107,8 @@ namespace AmagnoVirtualPrinter.Utils
public IUserConfig GetUserRegistryConfig(string sid)
{
+ Logger.Trace("GetUserRegistryConfig for {sid}", sid);
+
var regView = GetRegistryView();
var userConfig = new UserRegistryConfig();
diff --git a/Tests/AmagnoVirtualPrinter.Agent.Lib.Tests/AmagnoVirtualPrinter.Agent.Lib.Tests.csproj b/Tests/AmagnoVirtualPrinter.Agent.Lib.Tests/AmagnoVirtualPrinter.Agent.Lib.Tests.csproj
new file mode 100644
index 0000000..c0a4bca
--- /dev/null
+++ b/Tests/AmagnoVirtualPrinter.Agent.Lib.Tests/AmagnoVirtualPrinter.Agent.Lib.Tests.csproj
@@ -0,0 +1,67 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {36CD25FD-B1E2-4C87-970F-A40CCC961390}
+ {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ Library
+ Properties
+ AmagnoVirtualPrinter.Agent.Lib.Tests
+ AmagnoVirtualPrinter.Agent.Lib.Tests
+ v4.7.2
+ 512
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+ ..\..\packages\NUnit.3.5.0\lib\net45\nunit.framework.dll
+
+
+
+
+
+
+
+
+ {135c85eb-2116-4cc4-8ccb-b6804b9d6467}
+ AmagnoVirtualPrinter.Agent.Core
+
+
+ {94e8105f-5001-403b-b9f1-b0b0b236ad65}
+ AmagnoVirtualPrinter.Agent.Lib
+
+
+
+
+
+
diff --git a/Tests/AmagnoVirtualPrinter.Agent.Lib.Tests/PrintJobReaderTests.cs b/Tests/AmagnoVirtualPrinter.Agent.Lib.Tests/PrintJobReaderTests.cs
new file mode 100644
index 0000000..5f123f2
--- /dev/null
+++ b/Tests/AmagnoVirtualPrinter.Agent.Lib.Tests/PrintJobReaderTests.cs
@@ -0,0 +1,17 @@
+using AmagnoVirtualPrinter.Agent.Lib.Misc;
+using NUnit.Framework;
+
+namespace AmagnoVirtualPrinter.Agent.Lib.Tests
+{
+ [TestFixture]
+ public class PrintJobReaderTests
+ {
+ [Test]
+ public void GetCurrentPrintJobs_ReturnsJobs()
+ {
+ var jobs = PrintJobReader.GetCurrentPrintJobs("Amagno");
+
+ Assert.IsNull(jobs);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Tests/AmagnoVirtualPrinter.Agent.Lib.Tests/Properties/AssemblyInfo.cs b/Tests/AmagnoVirtualPrinter.Agent.Lib.Tests/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..86610cb
--- /dev/null
+++ b/Tests/AmagnoVirtualPrinter.Agent.Lib.Tests/Properties/AssemblyInfo.cs
@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("AmagnoVirtualPrinter.Agent.Lib.Tests")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("AmagnoVirtualPrinter.Agent.Lib.Tests")]
+[assembly: AssemblyCopyright("Copyright © 2023")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("36CD25FD-B1E2-4C87-970F-A40CCC961390")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
\ No newline at end of file
diff --git a/Tests/AmagnoVirtualPrinter.Agent.Lib.Tests/packages.config b/Tests/AmagnoVirtualPrinter.Agent.Lib.Tests/packages.config
new file mode 100644
index 0000000..c108d44
--- /dev/null
+++ b/Tests/AmagnoVirtualPrinter.Agent.Lib.Tests/packages.config
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/Tests/AmagnoVirtualPrinter.Utils.UnitTests/AmagnoVirtualPrinter.Utils.UnitTests.csproj b/Tests/AmagnoVirtualPrinter.Utils.UnitTests/AmagnoVirtualPrinter.Utils.UnitTests.csproj
new file mode 100644
index 0000000..2525745
--- /dev/null
+++ b/Tests/AmagnoVirtualPrinter.Utils.UnitTests/AmagnoVirtualPrinter.Utils.UnitTests.csproj
@@ -0,0 +1,63 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {2349BD8A-03E5-4226-B3C6-56C2F718B7CB}
+ {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ Library
+ Properties
+ AmagnoVirtualPrinter.Utils.UnitTests
+ AmagnoVirtualPrinter.Utils.UnitTests
+ v4.7.2
+ 512
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+ ..\..\packages\NUnit.3.5.0\lib\net45\nunit.framework.dll
+
+
+
+
+
+
+
+
+ {cd1c8e9d-5335-41ac-b0c0-88fd7c7c55f3}
+ AmagnoVirtualPrinter.Utils
+
+
+
+
+
+
diff --git a/Tests/AmagnoVirtualPrinter.Utils.UnitTests/Properties/AssemblyInfo.cs b/Tests/AmagnoVirtualPrinter.Utils.UnitTests/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..a5f8967
--- /dev/null
+++ b/Tests/AmagnoVirtualPrinter.Utils.UnitTests/Properties/AssemblyInfo.cs
@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("AmagnoVirtualPrinter.Utils.UnitTests")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("AmagnoVirtualPrinter.Utils.UnitTests")]
+[assembly: AssemblyCopyright("Copyright © 2023")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("2349BD8A-03E5-4226-B3C6-56C2F718B7CB")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
\ No newline at end of file
diff --git a/Tests/AmagnoVirtualPrinter.Utils.UnitTests/RegistryRepositoryTests.cs b/Tests/AmagnoVirtualPrinter.Utils.UnitTests/RegistryRepositoryTests.cs
new file mode 100644
index 0000000..84dea01
--- /dev/null
+++ b/Tests/AmagnoVirtualPrinter.Utils.UnitTests/RegistryRepositoryTests.cs
@@ -0,0 +1,19 @@
+using NUnit.Framework;
+
+namespace AmagnoVirtualPrinter.Utils.UnitTests
+{
+ [TestFixture]
+ public class RegistryRepositoryTests
+ {
+ [Test]
+ public void TryGetGhostscriptPath_FindsGhostScriptPath()
+ {
+ var sut = new RegistryRepository();
+
+ var result = sut.TryGetGhostscriptPath(out var path);
+
+ Assert.True(result);
+ Assert.IsNotNull(path);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Tests/AmagnoVirtualPrinter.Utils.UnitTests/packages.config b/Tests/AmagnoVirtualPrinter.Utils.UnitTests/packages.config
new file mode 100644
index 0000000..c108d44
--- /dev/null
+++ b/Tests/AmagnoVirtualPrinter.Utils.UnitTests/packages.config
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file