mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-06-19 18:48:15 +08:00
removed rafty and updated more packages
This commit is contained in:
@ -1,11 +1,10 @@
|
||||
namespace Ocelot.AcceptanceTests
|
||||
{
|
||||
using Butterfly.Client.AspNetCore;
|
||||
using Configuration.File;
|
||||
using Ocelot.Configuration.File;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Rafty.Infrastructure;
|
||||
using Shouldly;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
@ -147,7 +147,7 @@ namespace Ocelot.AcceptanceTests
|
||||
|
||||
private void ThenTheContentLengthShouldBeZero()
|
||||
{
|
||||
_contentLength.ShouldBeEquivalentTo(0L);
|
||||
_contentLength.ShouldBeNull();
|
||||
}
|
||||
|
||||
private void ThenTheContentLengthIs(int expected)
|
||||
|
@ -39,7 +39,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="3.1.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.0" />
|
||||
<PackageReference Include="Moq" Version="4.13.1" />
|
||||
<PackageReference Include="OpenTracing" Version="0.12.1" />
|
||||
@ -50,14 +50,14 @@
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="3.1.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="3.1.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="3.1.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="3.1.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="3.1.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="3.1.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.DotNet.InternalAbstractions" Version="1.0.500-preview2-1-003177" />
|
||||
<PackageReference Include="Shouldly" Version="4.0.0-beta0002" />
|
||||
<PackageReference Include="TestStack.BDDfy" Version="4.3.2" />
|
||||
@ -66,7 +66,6 @@
|
||||
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
|
||||
<PackageReference Include="IdentityServer4" Version="3.1.1" />
|
||||
<PackageReference Include="Consul" Version="1.6.1.1" />
|
||||
<PackageReference Include="Rafty" Version="0.4.4" />
|
||||
<PackageReference Include="CacheManager.Microsoft.Extensions.Logging" Version="2.0.0-beta-1629" />
|
||||
<PackageReference Include="CacheManager.Serialization.Json" Version="2.0.0-beta-1629" />
|
||||
<PackageReference Include="Steeltoe.Discovery.ClientCore" Version="2.4.2" />
|
||||
|
@ -8,7 +8,6 @@ namespace Ocelot.AcceptanceTests
|
||||
using OpenTracing;
|
||||
using OpenTracing.Propagation;
|
||||
using OpenTracing.Tag;
|
||||
using Rafty.Infrastructure;
|
||||
using Shouldly;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -17,6 +16,8 @@ namespace Ocelot.AcceptanceTests
|
||||
using TestStack.BDDfy;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public class OpenTracingTests : IDisposable
|
||||
{
|
||||
@ -513,4 +514,70 @@ namespace Ocelot.AcceptanceTests
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public class Wait
|
||||
{
|
||||
public static Waiter WaitFor(int milliSeconds)
|
||||
{
|
||||
return new Waiter(milliSeconds);
|
||||
}
|
||||
}
|
||||
|
||||
public class Waiter
|
||||
{
|
||||
private readonly int _milliSeconds;
|
||||
|
||||
public Waiter(int milliSeconds)
|
||||
{
|
||||
_milliSeconds = milliSeconds;
|
||||
}
|
||||
|
||||
public bool Until(Func<bool> condition)
|
||||
{
|
||||
var stopwatch = Stopwatch.StartNew();
|
||||
var passed = false;
|
||||
while (stopwatch.ElapsedMilliseconds < _milliSeconds)
|
||||
{
|
||||
if (condition.Invoke())
|
||||
{
|
||||
passed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return passed;
|
||||
}
|
||||
|
||||
public async Task<bool> Until(Func<Task<bool>> condition)
|
||||
{
|
||||
var stopwatch = Stopwatch.StartNew();
|
||||
var passed = false;
|
||||
while (stopwatch.ElapsedMilliseconds < _milliSeconds)
|
||||
{
|
||||
if (await condition.Invoke())
|
||||
{
|
||||
passed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return passed;
|
||||
}
|
||||
|
||||
public bool Until<T>(Func<bool> condition)
|
||||
{
|
||||
var stopwatch = Stopwatch.StartNew();
|
||||
var passed = false;
|
||||
while (stopwatch.ElapsedMilliseconds < _milliSeconds)
|
||||
{
|
||||
if (condition.Invoke())
|
||||
{
|
||||
passed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return passed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user