This session will address some tips and tricks to help bring some sanity to unit testing when dealing with Lambda Expressions. Lambdas provide some great benefits to making implementation of listeners and interfaces easier. They provide a much more compact way to represent Anonymous inline overrides, but they also run into the same problems when writing unit tests. As RXJava is being used more and more to make asynchronous code easier for Android, it is making it more difficult to unit test as well due. Forcing more integration testing and less unit testing. Causing in many causes for tests to no be written. We will look at some refactoring techniques that can be used, look at some situations where using a lambda may not be the best way to accomplish things. We’ll take a look at tools like Butterknife that can accomplish similar things but in a more straight forward way to allow unit testing to occur. In addition we’ll look at some ways to test those RXJava Lambda expressions. These patterns come from experience on a large retail project that has over 1000 tests and heavily leverages RXJava, Retrofit, Butterknife, Dagger, and many other square related frameworks. By the end, the attendees will have some tools they can take back, and apply to their own projects to help make unit testing easier when dealing with Lambda expressions.
By |2017-01-14T09:11:39-05:00January 14th, 2017|