Skip to content

Commit

Permalink
Merge pull request bugthesystem#13 from pjhuck/delete
Browse files Browse the repository at this point in the history
Remove DeleteResponse
  • Loading branch information
bugthesystem committed Mar 23, 2015
2 parents cc4e4c5 + 82099fd commit e51c774
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 38 deletions.
1 change: 0 additions & 1 deletion FireSharp.Tests/FirebaseClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ public async void Delete()

var response = await _firebaseClient.DeleteAsync("todos");
Assert.NotNull(response);
Assert.AreEqual(response.Success, true);
}

[Test]
Expand Down
6 changes: 2 additions & 4 deletions FireSharp.Tests/FiresharpTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public class FiresharpTests : TestBase
[TestFixtureSetUp]
public async void TestFixtureSetUp()
{
Task<DeleteResponse> task1 = _client.DeleteAsync("todos");
Task<DeleteResponse> task2 = _client.DeleteAsync("fakepath");
Task<FirebaseResponse> task1 = _client.DeleteAsync("todos");
Task<FirebaseResponse> task2 = _client.DeleteAsync("fakepath");
await Task.WhenAll(task1, task2);
}

Expand All @@ -48,7 +48,6 @@ public async Task DeleteAsync()

var response = await _client.DeleteAsync("todos/pushAsync");
Assert.NotNull(response);
Assert.IsTrue(response.Success);
}

[Test, Category("INTEGRATION"), Category("ASYNC")]
Expand Down Expand Up @@ -172,7 +171,6 @@ public void Delete()

var response = _client.Delete("todos/push");
Assert.NotNull(response);
Assert.IsTrue(response.Success);
}

[Test, Category("INTEGRATION"), Category("SYNC")]
Expand Down
1 change: 0 additions & 1 deletion FireSharp/FireSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
<Compile Include="Interfaces\IFirebaseClient.cs" />
<Compile Include="Interfaces\IRequestManager.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Response\DeleteResponse.cs" />
<Compile Include="Response\EventRootResponse.cs" />
<Compile Include="Response\EventStreamResponse.cs" />
<Compile Include="Response\FirebaseResponse.cs" />
Expand Down
8 changes: 4 additions & 4 deletions FireSharp/FirebaseClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ public PushResponse Push<T>(string path, T data)
}
}

public DeleteResponse Delete(string path)
public FirebaseResponse Delete(string path)
{
try
{
HttpResponseMessage response = _requestManager.Delete(path);
string content = response.Content.ReadAsStringAsync().Result;
HandleIfErrorResponse(response.StatusCode, content);
return new DeleteResponse(content, response.StatusCode);
return new FirebaseResponse(content, response.StatusCode);
}
catch (HttpRequestException ex)
{
Expand Down Expand Up @@ -158,14 +158,14 @@ public async Task<PushResponse> PushAsync<T>(string path, T data)
}
}

public async Task<DeleteResponse> DeleteAsync(string path)
public async Task<FirebaseResponse> DeleteAsync(string path)
{
try
{
HttpResponseMessage response = await _requestManager.DeleteAsync(path);
string content = await response.Content.ReadAsStringAsync();
HandleIfErrorResponse(response.StatusCode, content);
return new DeleteResponse(content, response.StatusCode);
return new FirebaseResponse(content, response.StatusCode);
}
catch (HttpRequestException ex)
{
Expand Down
4 changes: 2 additions & 2 deletions FireSharp/Interfaces/IFirebaseClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ public interface IFirebaseClient
Task<EventRootResponse<T>> OnChangeGetAsync<T>(string path, ValueRootAddedEventHandler<T> added = null);
Task<SetResponse> SetAsync<T>(string path, T data);
Task<PushResponse> PushAsync<T>(string path, T data);
Task<DeleteResponse> DeleteAsync(string path);
Task<FirebaseResponse> DeleteAsync(string path);
Task<FirebaseResponse> UpdateAsync<T>(string path, T data);
FirebaseResponse Get(string path);
SetResponse Set<T>(string path, T data);
PushResponse Push<T>(string path, T data);
DeleteResponse Delete(string path);
FirebaseResponse Delete(string path);
FirebaseResponse Update<T>(string path, T data);

[Obsolete("This method is obsolete use OnAsync instead.")]
Expand Down
26 changes: 0 additions & 26 deletions FireSharp/Response/DeleteResponse.cs

This file was deleted.

0 comments on commit e51c774

Please sign in to comment.