public void ShouldLogToInfoWhenRemovingAssembly()
        {
            var path = GetType().Assembly.Location;

            AssemblyContainer tested = new AssemblyContainer();
            MockLog           log    = new MockLog(tested);

            tested.Add(path);
            tested.Remove(path);

            Assert.IsTrue(log.Any(x => x.Level == MockLog.Level.Info && x.Message.Contains("Assembly removed ") && x.Message.Contains(path)));
        }
 public void RemoveHandlesUnknownAssembly()
 {
     try
     {
         AssemblyContainer tested = new AssemblyContainer();
         tested.Remove(GetType().Assembly.Location);
     }
     catch
     {
         Assert.Fail();
     }
 }
        public void RemoveShouldRaiseAssemblyRemovedForKnownAssembly()
        {
            AssemblyContainer tested = new AssemblyContainer();

            tested.Add(GetType().Assembly.Location);

            bool raisedAssemblyRemoved = false;

            tested.AssemblyRemoved += (s, e) => raisedAssemblyRemoved = true;
            tested.Remove(GetType().Assembly.Location);

            Assert.IsTrue(raisedAssemblyRemoved);
        }
        public void RemoveRequiresArgument()
        {
            AssemblyContainer tested = new AssemblyContainer();

            DoAssert.Throws <ArgumentNullException>(() => tested.Remove(null));
        }
        public void ShouldLogToInfoWhenRemovingAssembly()
        {
            var path = GetType().Assembly.Location;

              AssemblyContainer tested = new AssemblyContainer();
              MockLog log = new MockLog(tested);
              tested.Add(path);
              tested.Remove(path);

              Assert.IsTrue(log.Any(x => x.Level == MockLog.Level.Info && x.Message.Contains("Assembly removed ") && x.Message.Contains(path)));
        }
        public void RemoveShouldRaiseAssemblyRemovedForKnownAssembly()
        {
            AssemblyContainer tested = new AssemblyContainer();
              tested.Add(GetType().Assembly.Location);

              bool raisedAssemblyRemoved = false;
              tested.AssemblyRemoved += (s, e) => raisedAssemblyRemoved = true;
              tested.Remove(GetType().Assembly.Location);

              Assert.IsTrue(raisedAssemblyRemoved);
        }
 public void RemoveRequiresArgument()
 {
     AssemblyContainer tested = new AssemblyContainer();
       DoAssert.Throws<ArgumentNullException>(() => tested.Remove(null));
 }
 public void RemoveHandlesUnknownAssembly()
 {
     try
       {
     AssemblyContainer tested = new AssemblyContainer();
     tested.Remove(GetType().Assembly.Location);
       }
       catch
       {
     Assert.Fail();
       }
 }