Ejemplo n.º 1
0
        public void Install_Throws()
        {
            var src = new PortMonitor("Dummy Monitor");

            Assert.That(src.Exists, Is.False);
            Assert.That(src.CanInstall(), Is.False);

            src.FileName = "DummyMon.dll";
            Assert.That(src.CanInstall(), Is.True);

            src.Config = "DummyMonUi.dll";
            Assert.That(src.CanInstall(), Is.True);
            Assert.That(() => src.Install(), Throws.InstanceOf <Exception>());
        }
Ejemplo n.º 2
0
 /* ----------------------------------------------------------------- */
 ///
 /// Log
 ///
 /// <summary>
 /// Puts debug information to the log file.
 /// </summary>
 ///
 /// <param name="src">Port monitor object.</param>
 /// <param name="method">Method name.</param>
 ///
 /* ----------------------------------------------------------------- */
 public static void Log(this PortMonitor src,
                        [CallerMemberName] string method = null) => src.Put(
     $"[{method}]",
     $"{nameof(src.Name)}:{src.Name.Quote()}",
     $"{nameof(src.Exists)}:{src.Exists}",
     $"{nameof(src.CanInstall)}:{src.CanInstall()}",
     $"{nameof(src.Environment)}:{src.Environment.Quote()}",
     $"{nameof(src.FileName)}:{src.FileName.Quote()}",
     $"{nameof(src.Config)}:{src.Config.Quote()}",
     $"{nameof(src.TargetDirectory)}:{src.TargetDirectory.Quote()}"
     );
Ejemplo n.º 3
0
        public void CreateForce()
        {
            var name = "Dummy Port";
            var src  = new PortMonitor(name, new PortMonitor[0]);

            Assert.That(src.Name, Is.EqualTo(name));
            Assert.That(src.Exists, Is.False, nameof(src.Exists));
            Assert.That(src.CanInstall(), Is.False, nameof(src.CanInstall));
            Assert.That(src.FileName.HasValue(), Is.False, nameof(src.FileName));
            Assert.That(src.Config.HasValue(), Is.False, nameof(src.Config));
            Assert.That(src.Environment.HasValue(), Is.True, nameof(src.Environment));
            Assert.That(src.TargetDirectory.HasValue(), Is.True, nameof(src.TargetDirectory));
        }