Upgraded the Profile code to be contained inside a wrapper and started adding unit tests to cover.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user