cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Back again with another edition of 'How we use Dropbox', so find out how Emma uses to-do lists to get it all done here!

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unit testing

Unit testing

dennis s.23
New member | Level 1

I would like to know how others have solved the Problem of Unit Testing an app that uses the Dropbox API without going on the network. I am using the swift, .net and PHP sdk's.

Can I run a local Dropbox server and get the API's to use that endpoint?

 

1 Reply 1

Re: Unit testing

Richard P.
Super User alumni

You should be swapping out the Dropbox parts for mocks, which return ideal responses - you shouldnt ever test more code than absolutely necessary in a unit test, and that includes third party libraries or integrations.

If the Dropbox part fails, thats an entirely different ball game, but you should be assuming the response your unit tests requires, which means successes and failures as you test those parts of your code.

Poll
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?
Who's talking

Top contributors to this post

  • User avatar
    Richard P. Super User alumni
What do Dropbox user levels mean?
Need more support?