示例#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();
     }
 }
示例#4
0
 public void ShouldCreateANewInstanceWhenCallCtor()
 {
     using (var host = new KnifeHost())
     {
     }
 }