Ejemplo n.º 1
0
        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}");
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }