From b1f3962bb8c8f3e25da3899a2b5e81bb43c41d62 Mon Sep 17 00:00:00 2001 From: Einar Ingebrigtsen Date: Sun, 2 Feb 2025 11:49:34 +0100 Subject: [PATCH] Removing specs for removed code --- .../a_load_balanced_http_client_factory.cs | 19 ---------------- .../when_creating.cs | 22 ------------------- 2 files changed, 41 deletions(-) delete mode 100644 Source/Infrastructure.Specs/Net/for_LoadBalancedHttpClientFactory/given/a_load_balanced_http_client_factory.cs delete mode 100644 Source/Infrastructure.Specs/Net/for_LoadBalancedHttpClientFactory/when_creating.cs diff --git a/Source/Infrastructure.Specs/Net/for_LoadBalancedHttpClientFactory/given/a_load_balanced_http_client_factory.cs b/Source/Infrastructure.Specs/Net/for_LoadBalancedHttpClientFactory/given/a_load_balanced_http_client_factory.cs deleted file mode 100644 index 1759fb14b1..0000000000 --- a/Source/Infrastructure.Specs/Net/for_LoadBalancedHttpClientFactory/given/a_load_balanced_http_client_factory.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Cratis. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -namespace Cratis.Chronicle.Net.for_LoadBalancedHttpClientFactory.given; - -public class a_load_balanced_http_client_factory : Specification -{ - protected LoadBalancedHttpClientFactory _factory; - protected IHttpClientFactory _httpClientFactory; - protected ILoadBalancerStrategy _strategy; - - void Establish() - { - _strategy = Substitute.For(); - _httpClientFactory = Substitute.For(); - _factory = new(_strategy, _httpClientFactory); - _httpClientFactory.CreateClient(Arg.Any()).Returns(Substitute.For()); - } -} diff --git a/Source/Infrastructure.Specs/Net/for_LoadBalancedHttpClientFactory/when_creating.cs b/Source/Infrastructure.Specs/Net/for_LoadBalancedHttpClientFactory/when_creating.cs deleted file mode 100644 index 52acfa13d8..0000000000 --- a/Source/Infrastructure.Specs/Net/for_LoadBalancedHttpClientFactory/when_creating.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Cratis. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -namespace Cratis.Chronicle.Net.for_LoadBalancedHttpClientFactory; - -public class when_creating : given.a_load_balanced_http_client_factory -{ - HttpClient result; - IEnumerable endpoints; - int next; - - void Establish() - { - endpoints = Enumerable.Range(0, 5).Select(_ => new Uri($"http://{Guid.NewGuid()}")).ToArray().AsEnumerable(); - next = Random.Shared.Next(0, endpoints.Count()); - _strategy.GetNext(endpoints.Count()).Returns(next); - } - - void Because() => result = _factory.Create(endpoints); - - [Fact] void should_return_client_with_correct_endpoint() => result.BaseAddress.ShouldEqual(endpoints.ToArray()[next]); -}