public void IsActive_returns_true_when_MatcherObserver_instantiated() { using (var observer = MatcherObserver.Activate()) { Assert.True(MatcherObserver.IsActive(out _)); } }
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)); }
public void IsActive_returns_false_when_no_MatcherObserver_instantiated() { Assert.False(MatcherObserver.IsActive(out _)); }