Пример #1
0
 public void ShouldReturnServiceWhenGetService()
 {
     using (var knifeHost = new KnifeHost(new string[0]))
     {
         var innerHost = knifeHost.GetRequiredService <IHost>();
         innerHost.Should().NotBeNull();
     }
 }
Пример #2
0
 public void ShouldReturnServiceWhenGetService()
 {
     using (var knifeHost = new KnifeHost(new string[0]))
     {
         var innerHost = knifeHost.GetRequiredService <IHost>();
         Assert.IsNotNull(innerHost);
     }
 }
Пример #3
0
 public void ShouldCanBeStopedWhenRun()
 {
     using (var knifeHost = new KnifeHost(new string[0]))
     {
         var appLiftTime = knifeHost.GetRequiredService <IHostApplicationLifetime>();
         Task.Delay(500).ContinueWith(_ => { appLiftTime.StopApplication(); });
         knifeHost.Run();
     }
 }