Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create HTTP Post #16

Merged
merged 12 commits into from
Jan 16, 2018
Merged

Create HTTP Post #16

merged 12 commits into from
Jan 16, 2018

Conversation

ronanrodrigo
Copy link
Owner

@ronanrodrigo ronanrodrigo commented Jan 15, 2018

First part of issue #8 implementing POST method.

  • Create a body builder (birl!);
  • Create body builder tests;
  • Create NetworkPost class;
  • Create NetworkPostTests.

@@ -0,0 +1,15 @@
import Foundation

struct BodyBuilder: BodyBuildable {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create tests for this struct

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bodybuilder-porra

@codecov-io
Copy link

codecov-io commented Jan 15, 2018

Codecov Report

Merging #16 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #16   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          12     20    +8     
  Lines         163    240   +77     
  Branches       11     16    +5     
=====================================
+ Hits          163    240   +77
Impacted Files Coverage Δ
...es/Frisbee/Factories/FrisbeeEncodableFactory.swift 100% <100%> (ø)
Sources/Frisbee/Requestables/NetworkGet.swift 100% <100%> (ø) ⬆️
...rces/Frisbee/Interactors/URLWithQueryBuilder.swift 100% <100%> (ø) ⬆️
...ces/Frisbee/Factories/ResultGeneratorFactory.swift 100% <100%> (ø) ⬆️
Sources/Frisbee/Factories/URLRequestFactory.swift 100% <100%> (ø) ⬆️
Sources/Frisbee/Interactors/ResultGenerator.swift 100% <100%> (ø) ⬆️
Sources/Frisbee/Interactors/DataTaskRunner.swift 100% <100%> (ø)
...urces/Frisbee/Factories/BodyBuildableFactory.swift 100% <100%> (ø)
...bee/Factories/FrisbeeJSONSerializableFactroy.swift 100% <100%> (ø)
Sources/Frisbee/Requestables/NetworkPost.swift 100% <100%> (ø)
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cdbf9c1...ff4e7cb. Read the comment docs.

}

private func runTask<Entity: Decodable>(with request: URLRequest, onComplete: @escaping (Result<Entity>) -> Void) {
let task = urlSession.dataTask(with: request) { data, _, error in
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extract this to avoid duplication. Is the same at NetworkGet.

@ronanrodrigo ronanrodrigo merged commit 8c2c1e0 into master Jan 16, 2018
@ronanrodrigo ronanrodrigo added this to Done in Frisbee Project via automation Jan 16, 2018
@ronanrodrigo ronanrodrigo deleted the feature/http-post branch January 16, 2018 01:37
@ronanrodrigo ronanrodrigo mentioned this pull request Jan 16, 2018
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants