コード例 #1
0
ファイル: KnifeHostTest.cs プロジェクト: yscorecore/ys.knife
 public void ShouldReturnServiceWhenGetService()
 {
     using (var knifeHost = new KnifeHost(new string[0]))
     {
         var innerHost = knifeHost.GetRequiredService <IHost>();
         innerHost.Should().NotBeNull();
     }
 }
コード例 #2
0
ファイル: KnifeHostTest.cs プロジェクト: obpt123/ys.knife
 public void ShouldReturnServiceWhenGetService()
 {
     using (var knifeHost = new KnifeHost(new string[0]))
     {
         var innerHost = knifeHost.GetRequiredService <IHost>();
         Assert.IsNotNull(innerHost);
     }
 }
コード例 #3
0
ファイル: KnifeHostTest.cs プロジェクト: yscorecore/ys.knife
 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
ファイル: KnifeHostTest.cs プロジェクト: yscorecore/ys.knife
 public void ShouldCreateANewInstanceWhenCallCtor()
 {
     using (var host = new KnifeHost())
     {
     }
 }