Exemple #1
0
 public void IsActive_returns_true_when_MatcherObserver_instantiated()
 {
     using (var observer = MatcherObserver.Activate())
     {
         Assert.True(MatcherObserver.IsActive(out _));
     }
 }
Exemple #2
0
 public void Activations_can_be_nested()
 {
     Assert.False(MatcherObserver.IsActive(out var active));
     using (var outer = MatcherObserver.Activate())
     {
         Assert.True(MatcherObserver.IsActive(out active));
         Assert.Same(outer, active);
         using (var inner = MatcherObserver.Activate())
         {
             Assert.True(MatcherObserver.IsActive(out active));
             Assert.Same(inner, active);
         }
         Assert.True(MatcherObserver.IsActive(out active));
         Assert.Same(outer, active);
     }
     Assert.False(MatcherObserver.IsActive(out active));
 }
Exemple #3
0
 public void IsActive_returns_false_when_no_MatcherObserver_instantiated()
 {
     Assert.False(MatcherObserver.IsActive(out _));
 }