Wendy-Android icon indicating copy to clipboard operation
Wendy-Android copied to clipboard

Setup project for unit testing of the Wendy library

Open levibostian opened this issue 6 years ago • 2 comments

Wendy needs testing around it. At this time, that is all done through an example Android app in this repo that you can use to try out Wendy and see how it works. However, we all know unit tests are better.

The repo is currently not setup for good unit testing. It needs to be setup so that tests can then be created and added.

  • [ ] Setup testing to work with dependency injection to allow using mocked objects.
  • [ ] CI server run tests on each push (or pull request).
  • [ ] Code coverage reporting would be nice to have, but at this time not required.

After this is done...

  • [ ] Create issue to write the unit tests.
  • [ ] Create issue to setup and write tests for the example app in this project. Why? Because developers will be writing tests with Wendy as a dependency. Wendy needs to have a good API for devs to test against it in their own apps.

levibostian avatar Dec 08 '18 17:12 levibostian

For DI i would use Koin (just a suggestion) cuz it's really easy to make work and setup tests with

I also would use a linter in the project to enforce code quality (https://ktlint.github.io)

Grohden avatar Dec 09 '18 16:12 Grohden

Thanks for the suggestion, @Grohden. This issue is designed for adding unit testing specifically to the library. We should be able to pass in mocked objects into the constructors of each class in the Wendy library to test them without needing to use a library such as Koin or Dagger or others. The Wendy library itself should not need to have any 3rd party DI library installed to work.

However, for testing the example app, 3rd party libraries are acceptable. I only have experience with using Dagger2 but I have heard great things about Koin and am open to using that for tests in the example app.

levibostian avatar Dec 10 '18 17:12 levibostian