mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-06-19 01:58:15 +08:00
Removed unused usings, removed empty spaces, removed tons os warnings (#903)
This commit is contained in:
@ -1,14 +1,14 @@
|
||||
using System;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Moq;
|
||||
using Ocelot.Configuration;
|
||||
using Ocelot.Configuration.File;
|
||||
using Ocelot.Configuration.Setter;
|
||||
using Ocelot.Errors;
|
||||
using Ocelot.Responses;
|
||||
using Shouldly;
|
||||
using System;
|
||||
using TestStack.BDDfy;
|
||||
using Xunit;
|
||||
using Shouldly;
|
||||
using Ocelot.Configuration;
|
||||
|
||||
namespace Ocelot.UnitTests.Controllers
|
||||
{
|
||||
@ -29,8 +29,8 @@ namespace Ocelot.UnitTests.Controllers
|
||||
_repo = new Mock<IFileConfigurationRepository>();
|
||||
_setter = new Mock<IFileConfigurationSetter>();
|
||||
_controller = new FileConfigurationController(_repo.Object, _setter.Object, _provider.Object);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void should_get_file_configuration()
|
||||
{
|
||||
@ -45,15 +45,15 @@ namespace Ocelot.UnitTests.Controllers
|
||||
[Fact]
|
||||
public void should_return_error_when_cannot_get_config()
|
||||
{
|
||||
var expected = new Responses.ErrorResponse<FileConfiguration>(It.IsAny<Error>());
|
||||
|
||||
this.Given(x => x.GivenTheGetConfigurationReturns(expected))
|
||||
.When(x => x.WhenIGetTheFileConfiguration())
|
||||
.Then(x => x.TheTheGetFileConfigurationIsCalledCorrectly())
|
||||
.And(x => x.ThenTheResponseIs<BadRequestObjectResult>())
|
||||
.BDDfy();
|
||||
}
|
||||
|
||||
var expected = new Responses.ErrorResponse<FileConfiguration>(It.IsAny<Error>());
|
||||
|
||||
this.Given(x => x.GivenTheGetConfigurationReturns(expected))
|
||||
.When(x => x.WhenIGetTheFileConfiguration())
|
||||
.Then(x => x.TheTheGetFileConfigurationIsCalledCorrectly())
|
||||
.And(x => x.ThenTheResponseIs<BadRequestObjectResult>())
|
||||
.BDDfy();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void should_post_file_configuration()
|
||||
{
|
||||
@ -103,8 +103,8 @@ namespace Ocelot.UnitTests.Controllers
|
||||
}
|
||||
|
||||
private void ThenTheResponseIs<T>()
|
||||
{
|
||||
_result.ShouldBeOfType<T>();
|
||||
{
|
||||
_result.ShouldBeOfType<T>();
|
||||
}
|
||||
|
||||
private void GivenTheGetConfigurationReturns(Ocelot.Responses.Response<FileConfiguration> fileConfiguration)
|
||||
@ -120,16 +120,16 @@ namespace Ocelot.UnitTests.Controllers
|
||||
}
|
||||
|
||||
private void TheTheGetFileConfigurationIsCalledCorrectly()
|
||||
{
|
||||
_repo
|
||||
.Verify(x => x.Get(), Times.Once);
|
||||
{
|
||||
_repo
|
||||
.Verify(x => x.Get(), Times.Once);
|
||||
}
|
||||
|
||||
class FakeError : Error
|
||||
private class FakeError : Error
|
||||
{
|
||||
public FakeError() : base(string.Empty, OcelotErrorCode.CannotAddDataError)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user