public async Task ClearAsync() { Trace.WriteLine("New clear request"); ServerConfig[] servers = GetServersInternal(); Request[] requests = servers.Select(x => ClearRequest.New(x.Auth)).ToArray(); await _connectionPool.UseAsync(servers.Length, con => _clearProcessor.ExecuteAsync(requests, con, servers)); }
public void Handle_Clear_WorksCorrectly() { // Arrange var processor = new RequestProcessor(Substitute.For <IStorage>(), null, null, null, null, null, new ClearProcessor()); var request = ClearRequest.New(Auth.Default()); // Act Response response = processor.Handle(request, Auth.Default()); // Assert Assert.True(response.Success); Assert.True(string.IsNullOrEmpty(response.Exception)); Assert.NotNull(request.ClearRequest); }
public void ClearRequest_ReturnsNew() { // Arrange Auth auth = new Auth(); // Act var request = ClearRequest.New(auth); // Assert Assert.NotNull(request); Assert.Equal(request.Type, RequestType.Clear); Assert.NotNull(request.ClearRequest); Assert.Equal(auth, request.Auth); }