mirror of
				https://github.com/nsnail/Ocelot.git
				synced 2025-11-04 15:50:49 +08:00 
			
		
		
		
	removed some async we dont need
This commit is contained in:
		@@ -22,6 +22,12 @@ namespace Ocelot.ManualTest
 | 
			
		||||
                        .AddJsonFile("appsettings.json", true, true)
 | 
			
		||||
                        .AddJsonFile($"appsettings.{hostingContext.HostingEnvironment.EnvironmentName}.json", true, true)
 | 
			
		||||
                        .AddJsonFile("ocelot.json")
 | 
			
		||||
 | 
			
		||||
                        //.AddOcelot();
 | 
			
		||||
                        //load all the ocelot.xxx.json files that are not environments from asp.net core
 | 
			
		||||
                        //merge them into megaconfig
 | 
			
		||||
                        //save megaconfig to disk as ocelot.json
 | 
			
		||||
                        //then add to asp.net config stuff..
 | 
			
		||||
                        .AddEnvironmentVariables();
 | 
			
		||||
                })
 | 
			
		||||
                .ConfigureServices(s => {
 | 
			
		||||
 
 | 
			
		||||
@@ -49,7 +49,7 @@ namespace Ocelot.UnitTests.Configuration
 | 
			
		||||
 | 
			
		||||
        private void WhenIGetTheConfiguration()
 | 
			
		||||
        {
 | 
			
		||||
            _getResult = _repo.Get().Result;
 | 
			
		||||
            _getResult = _repo.Get();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private void GivenThereIsASavedConfiguration()
 | 
			
		||||
@@ -65,7 +65,7 @@ namespace Ocelot.UnitTests.Configuration
 | 
			
		||||
 | 
			
		||||
        private void WhenIAddOrReplaceTheConfig()
 | 
			
		||||
        {
 | 
			
		||||
            _result = _repo.AddOrReplace(_config).Result;
 | 
			
		||||
            _result = _repo.AddOrReplace(_config);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private void ThenNoErrorsAreReturned()
 | 
			
		||||
 
 | 
			
		||||
@@ -56,12 +56,12 @@ namespace Ocelot.UnitTests.Configuration
 | 
			
		||||
        {
 | 
			
		||||
            _configurationRepository
 | 
			
		||||
                .Setup(x => x.Get())
 | 
			
		||||
                .ReturnsAsync(config);
 | 
			
		||||
                .Returns(config);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private void WhenIGetTheConfig()
 | 
			
		||||
        {
 | 
			
		||||
            _result = _ocelotConfigurationProvider.Get().Result;
 | 
			
		||||
            _result = _ocelotConfigurationProvider.Get();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private void TheFollowingIsReturned(Response<IOcelotConfiguration> expected)
 | 
			
		||||
 
 | 
			
		||||
@@ -79,7 +79,7 @@ namespace Ocelot.UnitTests.DownstreamRouteFinder
 | 
			
		||||
            _config = config;
 | 
			
		||||
            _provider
 | 
			
		||||
                .Setup(x => x.Get())
 | 
			
		||||
                .ReturnsAsync(new OkResponse<IOcelotConfiguration>(_config));
 | 
			
		||||
                .Returns(new OkResponse<IOcelotConfiguration>(_config));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private void GivenTheDownStreamRouteFinderReturns(DownstreamRoute downstreamRoute)
 | 
			
		||||
 
 | 
			
		||||
@@ -134,7 +134,7 @@ namespace Ocelot.UnitTests.Errors
 | 
			
		||||
        {
 | 
			
		||||
            var ex = new Exception("outer", new Exception("inner"));
 | 
			
		||||
             _provider
 | 
			
		||||
                .Setup(x => x.Get()).ThrowsAsync(ex);
 | 
			
		||||
                .Setup(x => x.Get()).Throws(ex);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private void ThenAnExceptionIsThrown()
 | 
			
		||||
@@ -146,7 +146,7 @@ namespace Ocelot.UnitTests.Errors
 | 
			
		||||
        {
 | 
			
		||||
            var response = new Responses.ErrorResponse<IOcelotConfiguration>(new FakeError());
 | 
			
		||||
            _provider
 | 
			
		||||
                .Setup(x => x.Get()).ReturnsAsync(response);
 | 
			
		||||
                .Setup(x => x.Get()).Returns(response);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private void TheRequestIdIsSet(string key, string value)
 | 
			
		||||
@@ -158,7 +158,7 @@ namespace Ocelot.UnitTests.Errors
 | 
			
		||||
        {
 | 
			
		||||
            var response = new Responses.OkResponse<IOcelotConfiguration>(config);
 | 
			
		||||
            _provider
 | 
			
		||||
                .Setup(x => x.Get()).ReturnsAsync(response);
 | 
			
		||||
                .Setup(x => x.Get()).Returns(response);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private void GivenAnExceptionWillNotBeThrownDownstream()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user