-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add to better error handling in service tester when silo forcibly clo…
…se (#174) * Add to better error handling in service tester when silo forcibly close
- Loading branch information
eran
authored
Jun 12, 2018
1 parent
3496ed2
commit 347ae8f
Showing
5 changed files
with
110 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
tests/Gigya.Microdot.Orleans.Hosting.UnitTests/ServiceTesterTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#region Copyright | ||
// Copyright 2017 Gigya Inc. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS" | ||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | ||
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
// POSSIBILITY OF SUCH DAMAGE. | ||
#endregion | ||
|
||
using System; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Gigya.Common.Contracts.HttpService; | ||
using Gigya.Microdot.Orleans.Hosting.UnitTests.Microservice.CalculatorService; | ||
using Gigya.Microdot.ServiceProxy; | ||
using Gigya.Microdot.Testing.Service; | ||
using NUnit.Framework; | ||
using Shouldly; | ||
|
||
namespace Gigya.Microdot.Orleans.Hosting.UnitTests | ||
{ | ||
[TestFixture] | ||
public class ServiceTesterTests | ||
{ | ||
private ServiceTester<CalculatorServiceHost> _tester; | ||
|
||
|
||
[Test] | ||
public async Task ServiceTesterWhenServiceFailedToGracefullyShutdownShouldThrow() | ||
{ | ||
_tester = AssemblyInitialize.ResolutionRoot.GetServiceTester<CalculatorServiceHost>(8555,shutdownWaitTime:TimeSpan.Zero); | ||
|
||
Action act = () => _tester.Dispose(); | ||
act.ShouldThrow<Exception>().Message.ShouldContain("service failed to shutdown gracefully"); | ||
} | ||
|
||
} | ||
|
||
} |