public async Task DeleteAsync(string key) { Trace.WriteLine("New delete request"); ServerConfig server = GetServerInternal(key); Request request = DeleteRequest.New(key, server.Auth); var response = await _connectionPool.UseAsync(con => _deleteProcessor.ExecuteAsync(request, con, server)); Debug.WriteLine($"InsertRequest status: {response.Deleted}"); }
public void Handle_Delete_WorksCorrectly() { // Arrange var processor = new RequestProcessor(Substitute.For <IStorage>(), null, null, new DeleteProcessor(), null, null, null); var request = DeleteRequest.New("key", Auth.Default()); // Act Response response = processor.Handle(request, Auth.Default()); // Assert Assert.True(response.Success); Assert.True(string.IsNullOrEmpty(response.Exception)); Assert.NotNull(request.DeleteRequest); }
public void DeleteRequest_ReturnsNew() { // Arrange const string key = "lorem ipsum"; Auth auth = new Auth(); // Act var request = DeleteRequest.New(key, auth); // Assert Assert.NotNull(request); Assert.Equal(request.Type, RequestType.Delete); Assert.NotNull(request.DeleteRequest); Assert.Equal(request.DeleteRequest.Key, key); Assert.Equal(auth, request.Auth); }