public void CloseDependencyTest() { var mock = new Mock <IDisposable>(); mock.Setup(p => p.Dispose()); ApplicationContext context = new ApplicationContext(); context.Resolvers.Add(Resolver.CreateSingleton(mock.Object)); IDisposable value = context.Resolve <IDisposable>(); Assert.AreEqual(mock.Object, value); mock.Verify(p => p.Dispose(), Times.Never); context.Close(); mock.Verify(p => p.Dispose(), Times.Once); }
protected override void OnExit(ExitEventArgs e) { UIApplication.Close(); ApplicationContext.Close(); base.OnExit(e); }
protected override void OnStop() { Destroy(); ServiceContext.Close(); ApplicationContext.Close(); }