How to write the simplest UnitTest to the simplest functions?

I want to learn how to write tests for my projects.

Tell me some good resources to learn how to test Android applications.

How important is their use?

Now I am writing an application without using them and so far I can’t evaluate their benefits.

I don’t remember those codes that I meet on the Internet to meet tests somewhere in the code.

In general, I want to understand what this means. Tell me where to start.

Suppose there is such a method:

private File getFile(File path) {     String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());     return new File(path.getPath() + File.separator + timeStamp + ".html"); }

How can I write a test for him and what needs to be done to do this?

AMENDMENT

By the way, there’s a link with a video showing an example test

https://www.youtube.com/watch?v=ZJE0MDKJOow

Asked on February 4, 2020 in Programming.
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.