public void AddAfterDisposed() { var counter = new ScopeCounter(Mock.Of <ILifetimeScope>()); counter.Release(); counter.Add(); }
public void AddAndRelease() { var scope = new Mock <ILifetimeScope>(MockBehavior.Strict); scope.Setup(_ => _.Dispose()); var counter = new ScopeCounter(scope.Object); counter.Add(); counter.Add(); counter.Release(); counter.Release(); counter.Release(); Assert.IsNull(counter.Scope); scope.VerifyAll(); }