Files
onefuzz/src/ApiService/Tests/Fakes/TestCreds.cs
George Pollard 1eeefce85c Implement info Function in C# (#2061)
Adds implementation of the `info` function. 

Added support for blobs in the function integration test stuff.

Simplified usage of integration test classes by removing the account name parameter.
2022-06-23 13:06:40 +12:00

57 lines
1.5 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Resources;
using Microsoft.OneFuzz.Service;
using Task = System.Threading.Tasks.Task;
namespace Tests.Fakes;
class TestCreds : ICreds {
private readonly Guid _subscriptionId;
private readonly string _resourceGroup;
private readonly string _region;
public TestCreds(Guid subscriptionId, string resourceGroup, string region) {
_subscriptionId = subscriptionId;
_resourceGroup = resourceGroup;
_region = region;
}
public ArmClient ArmClient => null!;
// we have to return something in some test cases, even if it isnt used
public Task<string> GetBaseRegion() => Task.FromResult(_region);
public string GetBaseResourceGroup() => _resourceGroup;
public string GetSubscription() => _subscriptionId.ToString();
public DefaultAzureCredential GetIdentity() {
throw new NotImplementedException();
}
public string GetInstanceName() {
throw new NotImplementedException();
}
public Uri GetInstanceUrl() {
throw new NotImplementedException();
}
public ResourceGroupResource GetResourceGroupResource() {
throw new NotImplementedException();
}
public ResourceIdentifier GetResourceGroupResourceIdentifier() {
throw new NotImplementedException();
}
public Guid GetScalesetPrincipalId() {
throw new NotImplementedException();
}
}