예제 #1
0
        public async Task InitializeAsync_success()
        {
            var appInitializer = new TestAppInitializer();

            await appInitializer.InitializeAsync(Mock.Create<IAppContext>());

            Assert.IsTrue(appInitializer.GetInitializationMonitor().IsCompletedSuccessfully);
        }
예제 #2
0
        public void InitializeAsync_exception()
        {
            var appInitializer = new TestAppInitializer(new AmbiguousMatchException());

            Assert.That(() => appInitializer.InitializeAsync(Mock.Create<IAppContext>()), Throws.TypeOf<AmbiguousMatchException>());

            Assert.IsTrue(appInitializer.GetInitializationMonitor().IsFaulted);
        }