Пример #1
0
 public void ContainsWithDifferentType()
 {
     using (SingletonsContainer.Get <MyDisposable>("foo"))
     {
         Assert.IsFalse(SingletonsContainer.Contains <DummyDisposable>("foo"));
     }
 }
Пример #2
0
 public void ContainsExistingWithKey()
 {
     using (SingletonsContainer.Get <MyDisposable>("foo"))
     {
         Assert.IsTrue(SingletonsContainer.Contains <MyDisposable>("foo"));
     }
 }
Пример #3
0
        public void DisposeSingletons_NullSingleton_DoesNotCrash()
        {
            SingletonsContainer.Add(typeof(MyDisposable).FullName, null);

            Assert.That(() => SingletonsContainer.Release(), Throws.Nothing);

            Assert.That(SingletonsContainer.Contains <MyDisposable>(), Is.False);
        }
Пример #4
0
 public void ContainsNonExistingWithKey()
 {
     Assert.IsFalse(SingletonsContainer.Contains <MyDisposable>("foo"));
 }
Пример #5
0
 public void ContainsNonExisting()
 {
     Assert.IsFalse(SingletonsContainer.Contains <MyDisposable>());
 }
Пример #6
0
 public void ContainsNullSingleton()
 {
     SingletonsContainer.Add(typeof(MyDisposable).FullName, null);
     Assert.That(SingletonsContainer.Contains <MyDisposable>(), Is.True);
 }