I just found out about this really nice library called Mockito (Docs) (Homepage). This will make our project testing much more predictable.
An example of this is when our app display certain questions, Mockito can sense upcoming questions and simulate a corresponding user input. For example
when(asker.ask("What subbredit do you want to download from?")).thenReturn("aww");
when(asker.ask("Enter how many pictures do you want to download:")).thenReturn(3);
The reason why I brought this up is because certain test method has unpredictable behaviours such as the start() method, where the input pattern varies on the input itself. For example a subreddit with pictures will enforce the open folder option at the end; otherwise, this is skip.
With Mockito, we don't have to check manually the subreddit, if this behaviour will happen to procure certain test case inputs, we can simply let Mockito predict it by using when condition methods. There's a whole lot more functionality we can use.
I just found out about this really nice library called Mockito (Docs) (Homepage). This will make our project testing much more predictable.
An example of this is when our app display certain questions, Mockito can sense upcoming questions and simulate a corresponding user input. For example
The reason why I brought this up is because certain test method has unpredictable behaviours such as the start() method, where the input pattern varies on the input itself. For example a subreddit with pictures will enforce the open folder option at the end; otherwise, this is skip.
With Mockito, we don't have to check manually the subreddit, if this behaviour will happen to procure certain test case inputs, we can simply let Mockito predict it by using when condition methods. There's a whole lot more functionality we can use.