1
0
mirror of https://github.com/bitwarden/server.git synced 2024-12-05 14:23:30 +01:00
bitwarden-server/perf/MicroBenchmarks/Identity/IdentityServer/StaticClientStoreTests.cs
Justin Baur aa34bbb0e6
Fix Most Test Warnings (#4612)
* Add Collections Tests

* Update CollectionRepository Implementation

* Test Adding And Deleting Through Replace

* Format

* Fix Most Test Warnings

* Format
2024-08-15 17:14:22 -04:00

28 lines
718 B
C#

using BenchmarkDotNet.Attributes;
using Bit.Core.Settings;
using Bit.Identity.IdentityServer;
using Duende.IdentityServer.Models;
namespace Bit.MicroBenchmarks.Identity.IdentityServer;
public class StaticClientStoreTests
{
private readonly StaticClientStore _store;
public StaticClientStoreTests()
{
_store = new StaticClientStore(new GlobalSettings());
}
[Params("mobile", "connector", "invalid", "a_much_longer_invalid_value_that_i_am_making_up", "WEB", "")]
public string ClientId { get; set; } = null!;
[Benchmark]
public Client? TryGetValue()
{
return _store.ApiClients.TryGetValue(ClientId, out var client)
? client
: null;
}
}