Giter Site home page Giter Site logo

Tests about rxjava-android-samples HOT 16 CLOSED

kaushikgopal avatar kaushikgopal commented on May 7, 2024
Tests

from rxjava-android-samples.

Comments (16)

kaushikgopal avatar kaushikgopal commented on May 7, 2024

Would i be interested?

No not just interested. I would <3 to have this in. This has been on my todo list forever.

Your strategy of starting with just one example sounds perfect. Would really appreciate it.

from rxjava-android-samples.

EGecius avatar EGecius commented on May 7, 2024

great :) Writing tests is my favourite part in programming :)

I have written a first test as an example but received this message when pushing:
"remote: Permission to kaushikgopal/RxJava-Android-Samples.git denied to EGecius."

I guess I need granting a permission by you.

from rxjava-android-samples.

EGecius avatar EGecius commented on May 7, 2024

by the way, I am a huge fan of your podcasts. Thank so much for making them, and especially for making them lively and fun too :) love your sense of playfulness on it :)

from rxjava-android-samples.

kaushikgopal avatar kaushikgopal commented on May 7, 2024

Thanks for the kind words EGecius! do appreciate it.

hmm.. that's interesting. you should open up a pull request with github. you might be trying to push directly to the repo. let me know if you're still facing issues.

from rxjava-android-samples.

EGecius avatar EGecius commented on May 7, 2024

I have a separate branch called 'first_test' but can't push it. I get the following message:

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v --tags --set-upstream origin refs/heads/first_test:refs/heads/first_test
Pushing to https://github.com/kaushikgopal/RxJava-Android-Samples.git
remote: Permission to kaushikgopal/RxJava-Android-Samples.git denied to EGecius.
fatal: unable to access 'https://github.com/kaushikgopal/RxJava-Android-Samples.git/': The requested URL returned error: 403
Completed with errors, see above

from rxjava-android-samples.

EGecius avatar EGecius commented on May 7, 2024

I have no problems pushing to my own repositories. I think I remember last time I had a similar problem, the owner of the repository added me as a contributor and I had no problems after it.

from rxjava-android-samples.

kaushikgopal avatar kaushikgopal commented on May 7, 2024

Pushing to https://github.com/kaushikgopal/RxJava-Android-Samples.git

So that message indicates that you're trying to push directly to the repo
without a PR (Pull request). If you take a look at github's instructions
here http://goog_1513273970
https://guides.github.com/activities/contributing-to-open-source/ (see the
Pull Request section), that should definitely work.

Other people have contributed to this same repo without any permission
changes, so there shouldn't technically be a problem with permissions.

I would need to add you as a contributor only if the project was private.
Open source public projects don't have that restriction.

Kaushik

On Wed, Jan 27, 2016 at 8:35 AM, Egidijus Gecius [email protected]
wrote:

I have no problems pushing to my own repositories. I think I remember last
time I had a similar problem, the owner of the repository added me as a
contributor and I had no problems after it.


Reply to this email directly or view it on GitHub
#38 (comment)
.

from rxjava-android-samples.

EGecius avatar EGecius commented on May 7, 2024

my apologies. I had not forked the project. It makes total sense now :)

PR created

from rxjava-android-samples.

EGecius avatar EGecius commented on May 7, 2024

feel free to make suggestions how to organise code, packages, etc.. I do have strong preferences as long as I can easily write tests, which is my favourite part.

from rxjava-android-samples.

WassimBenltaief avatar WassimBenltaief commented on May 7, 2024

That will be good to include some unit testing. What about refactoring as EGecius said ? Then like he did in the last pull request, what can be done is :
Either moving the rx observables out of the activities to some helpers and keep the subscribers or moving all to a second layer (Presenter for ex.) and return only emitted data to the view.

from rxjava-android-samples.

marukami avatar marukami commented on May 7, 2024

I think keeping the subscriber in the fragments is fine. If you move the subscribers into the helper it's self then it becomes harder to inject the TestSubscriber. Making the Observable s side effect free and returning all the transformed data to the view should work pretty well.

from rxjava-android-samples.

kaushikgopal avatar kaushikgopal commented on May 7, 2024

the test look awesome and is definitely in the right direction imho.

Either moving the rx observables out of the activities to some helpers and keep the subscribers or moving all to a second layer (Presenter for ex.) and return only emitted data to the view.

if this was a full blown project that recommendation would definitely be the way i would like to go. that being said, the whole point of this project is to help folks quickly understand how to use an observable. i don't have a great feeling burying the most important parts of the code with more abstraction using helpers/presenters etc.

it does make it a tad bit tricky though, since enabling the writing of tests requires some re-jiggering of the code (thanks Android!).

Maybe just making ConcurrencyWithSchedulersHelper as an internal class of the fragment might just do it ¯_(ツ)_/¯

i definitely want to explore more less-intrusive ways of adding tests without changing the code.

from rxjava-android-samples.

WassimBenltaief avatar WassimBenltaief commented on May 7, 2024

Yes absolutely. internal Helpers classes are more than enough for test purpose.

from rxjava-android-samples.

marukami avatar marukami commented on May 7, 2024

I wonder if you can use the RxJavaPlugins.getInstance().registerObservableExecutionHook to inject a test subscriber.

from rxjava-android-samples.

kaushikgopal avatar kaushikgopal commented on May 7, 2024

yup, was thinking along the same lines. I implemented something similar in another repo here:
https://github.com/kaushikgopal/rem/blob/master/app/src/test/java/co/kaush/rem/ui/list/TaskListControllerTest.java#L42

from rxjava-android-samples.

kaushikgopal avatar kaushikgopal commented on May 7, 2024

heya, was doing some cleanup. my bad for letting this go unattended, for so long.

if you still feel strongly about this PR, chime in. if we mutually agree it's something that needs to go into the repo, we'll have to work towards rebasing the changes again over the latest master.

✌️

from rxjava-android-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.