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

Automated Unit Tests Have Poor Coverage #37

Closed
baumatron opened this issue Nov 22, 2016 · 3 comments
Closed

Automated Unit Tests Have Poor Coverage #37

baumatron opened this issue Nov 22, 2016 · 3 comments
Assignees

Comments

@baumatron
Copy link
Contributor

Unit tests don't actually exercise core components of the SDK. The EventCollection and Event classes are basically untested by automated testing.

A solution would be to do away with the UseMocks flag found in the tests, and use a mock HTTP protocol handler that would validate requests and provide canned responses.

masojus added a commit that referenced this issue Feb 24, 2017
…the .NET4/4.5+/PCL libs:

- We really need to centralize the creation of HttpClients for a number of reasons.
- Issue #37 points out a reason: using http handlers, we can achieve way better CC numbers.
- @baumatron already did some work in this area, so I want to cherry-pick his changes and use them to centralize lazy construction of an HttpClient for the various types of keys, or switch to using HttpRequestMessage in helpers to set the headers and other settings.
- We then can build up the mock infrastructure around that to extend testing, including testing HTTP headers for all HTTP requests--e.g. ensuring the "Authorization" and "Keen-Sdk" headers are there, as well as others. Again locally @baumatron already did some of this, so I didn't do it here, but we'll get that cleaned up and checked in soon.
- Also just not having this header-related code scattered everywhere.
@masojus
Copy link
Contributor

masojus commented Jul 21, 2017

For the purposes of #dotnetsummer work we can split this up into more specific tasks if someone is interested. This might even go hand in hand with writing tests for work as it's ported to dotnetstandard.

@baumatron
Copy link
Contributor Author

Been pushing tests to increase_coverage_2, which is a WIP.

@baumatron baumatron self-assigned this Oct 17, 2017
@masojus masojus mentioned this issue Nov 7, 2017
@masojus
Copy link
Contributor

masojus commented Nov 11, 2017

Marking as closed with PR #127 since code coverage is increased quite a bit. There's still more that can be done, but that can be handled in newer specific issues.

@masojus masojus closed this as completed Nov 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants