amnmblchllng / survey-list-app

0 stars 0 forks source link

Testing #9

Open dekablade01 opened 4 years ago

dekablade01 commented 4 years ago
amnmblchllng commented 4 years ago

Hi,

dekablade01 commented 4 years ago
  • What kind of tests for the ViewController? As it's mostly UI I can't think of Unit Tests for it right now. UI Tests then?

Yes you're right, what you can assert in UI Tests are is buttons, images really exists, is it navigate to next ViewControler when button did tap

But what I mean is view controller doesn't contains only UI implementation, but also contains fetching logics eg like

  • I agree that mocking is a good idea. Although unit tests can also use server responses (almost integration tests). It would make sense to provide both mock+server I think.
amnmblchllng commented 4 years ago
  • how can you be sure that the pagegination is not hard coded value like page is always equal to 1 ?

i'm not sure what you mean. the page changes recursively.

  • how can you be sure that the view controller is going to fetch the surveys ?

it's in view did load. Im not sure how else to test that, without using UI tests.

  • the challenge requires unit tests not Integration tests.
  • Unit test is for developers to test their code is it working as expected or not, while integration is for ops to test that the whole service is working as expected or not.

Yes I know, though tests that use the API can still be unit tests