Upgraded the Profile code to be contained inside a wrapper and started adding unit tests to cover.

This commit is contained in:
2019-10-21 21:16:09 +01:00
parent 438ec779b4
commit a155e27eac
7 changed files with 251 additions and 5 deletions
+8 -1
View File
@@ -2289,6 +2289,13 @@ namespace ASCOM.Meade.net
#region ASCOM Registration
private static IProfileFactory _profileFactory;
public static IProfileFactory ProfileFactory
{
get => _profileFactory ?? (_profileFactory = new ProfileFactory());
set => _profileFactory = value;
}
// Register or unregister driver for ASCOM. This is harmless if already
// registered or unregistered.
//
@@ -2299,7 +2306,7 @@ namespace ASCOM.Meade.net
/// <param name="bRegister">If <c>true</c>, registers the driver, otherwise unregisters it.</param>
private static void RegUnregAscom(bool bRegister)
{
using (var p = new Profile())
using (IProfileWrapper p = ProfileFactory.Create())
{
p.DeviceType = "Telescope";
if (bRegister)