mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-06-19 14:58:16 +08:00
Feat/monorepo (#734)
* copied everything from repos back to ocelot repo * added src projects to sln * removed all test projects that have no tests * added all test projects to sln * removed test not on master * merged unit tests * merged acceptance tests * merged integration tests * fixed namepaces * build script creates packages for all projects * updated docs to make sure no references to external repos that we will remove * +semver: breaking
This commit is contained in:
34
test/Ocelot.UnitTests/Eureka/EurekaProviderFactoryTests.cs
Normal file
34
test/Ocelot.UnitTests/Eureka/EurekaProviderFactoryTests.cs
Normal file
@ -0,0 +1,34 @@
|
||||
namespace Ocelot.UnitTests.Eureka
|
||||
{
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Moq;
|
||||
using Ocelot.Configuration.Builder;
|
||||
using Provider.Eureka;
|
||||
using Shouldly;
|
||||
using Steeltoe.Common.Discovery;
|
||||
using Xunit;
|
||||
|
||||
public class EurekaProviderFactoryTests
|
||||
{
|
||||
[Fact]
|
||||
public void should_not_get()
|
||||
{
|
||||
var config = new ServiceProviderConfigurationBuilder().Build();
|
||||
var sp = new ServiceCollection().BuildServiceProvider();
|
||||
var provider = EurekaProviderFactory.Get(sp, config, null);
|
||||
provider.ShouldBeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void should_get()
|
||||
{
|
||||
var config = new ServiceProviderConfigurationBuilder().WithType("eureka").Build();
|
||||
var client = new Mock<IDiscoveryClient>();
|
||||
var services = new ServiceCollection();
|
||||
services.AddSingleton<IDiscoveryClient>(client.Object);
|
||||
var sp = services.BuildServiceProvider();
|
||||
var provider = EurekaProviderFactory.Get(sp, config, null);
|
||||
provider.ShouldBeOfType<Eureka>();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user