-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* change config creator to not throw exception in there is an error......lord i hate this config creator code I need to sort it out. * Remove method that we are not using anymore.. * throw exception and add errors to message * train hacking and some refactoring * bs test for code coverage * actually return the errors in the exception
- Loading branch information
1 parent
6289992
commit 3b27bb3
Showing
7 changed files
with
227 additions
and
85 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
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,58 @@ | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using Microsoft.AspNetCore.Hosting; | ||
using Ocelot.Configuration.File; | ||
using Shouldly; | ||
using TestStack.BDDfy; | ||
using Xunit; | ||
|
||
namespace Ocelot.AcceptanceTests | ||
{ | ||
public class CannotStartOcelotTests : IDisposable | ||
{ | ||
private IWebHost _builder; | ||
private readonly Steps _steps; | ||
private string _downstreamPath; | ||
|
||
public CannotStartOcelotTests() | ||
{ | ||
_steps = new Steps(); | ||
} | ||
|
||
[Fact] | ||
public void should_throw_exception_if_cannot_start() | ||
{ | ||
var invalidConfig = new FileConfiguration() | ||
{ | ||
ReRoutes = new List<FileReRoute> | ||
{ | ||
new FileReRoute | ||
{ | ||
UpstreamPathTemplate = "api", | ||
DownstreamPathTemplate = "test" | ||
} | ||
} | ||
}; | ||
|
||
Exception exception = null; | ||
_steps.GivenThereIsAConfiguration(invalidConfig); | ||
try | ||
{ | ||
_steps.GivenOcelotIsRunning(); | ||
} | ||
catch(Exception ex) | ||
{ | ||
exception = ex; | ||
} | ||
|
||
exception.ShouldNotBeNull(); | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
_builder?.Dispose(); | ||
_steps.Dispose(); | ||
} | ||
} | ||
} |
Oops, something went wrong.