mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-17 04:18:07 +00:00
Integration tests project (#2083)
Move integration tests into their own project. This makes it easier to run unit tests if you don't want to (or don't have) `azurite` running, since you can `dotnet test` just that directory. Also add a check into the `AzuriteStorage` class that will abort the entire test run if `azurite` is not running, which is simpler than reading lots of socket exceptions.
This commit is contained in:
19
src/ApiService/IntegrationTests/Fakes/TestUserCredentials.cs
Normal file
19
src/ApiService/IntegrationTests/Fakes/TestUserCredentials.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Azure.Functions.Worker.Http;
|
||||
using Microsoft.OneFuzz.Service;
|
||||
|
||||
using Async = System.Threading.Tasks;
|
||||
|
||||
namespace IntegrationTests.Fakes;
|
||||
|
||||
sealed class TestUserCredentials : UserCredentials {
|
||||
|
||||
private readonly OneFuzzResult<UserInfo> _tokenResult;
|
||||
|
||||
public TestUserCredentials(ILogTracer log, IConfigOperations instanceConfig, OneFuzzResult<UserInfo> tokenResult)
|
||||
: base(log, instanceConfig) {
|
||||
_tokenResult = tokenResult;
|
||||
}
|
||||
|
||||
public override Task<OneFuzzResult<UserInfo>> ParseJwtToken(HttpRequestData req) => Async.Task.FromResult(_tokenResult);
|
||||
}
|
Reference in New Issue
Block a user