mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-27 06:52:52 +08:00
53 lines
1.2 KiB
C#
53 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Ocelot.Configuration.File;
|
|
using Shouldly;
|
|
using Xunit;
|
|
|
|
namespace Ocelot.AcceptanceTests
|
|
{
|
|
public class CannotStartOcelotTests : IDisposable
|
|
{
|
|
private readonly Steps _steps;
|
|
|
|
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()
|
|
{
|
|
_steps.Dispose();
|
|
}
|
|
}
|
|
}
|