All Questions
Tagged with java unit-testing
195 questions
1
vote
2
answers
105
views
simple Text Table utility
A small utility to print data in an ascii table
TextTable
...
2
votes
1
answer
583
views
Basic Ticket booking code with Unit tests
I am going to run a session for a few other developers who are new to Junit, mocking, etc.
I have designed a very simple application with classes and tests to demonstrate how to do unit testing. ...
0
votes
1
answer
100
views
First time writing tests (Service Layer)
Service class:
...
1
vote
1
answer
95
views
A simple Java integer integer hash set - follow-up 2
(See the previous version.)
Now I have this:
com.github.coderodde.util.IntHashSet:
...
6
votes
4
answers
1k
views
A simple Java integer hash set
(See the next version.)
The following data structure implements a hash table based set for int values:
...
5
votes
2
answers
506
views
Hungarian algorithm for optimal assignment
The assignment problem is about assigning tasks to workers, where each pair (worker, task) has a cost. The Hungarian algorithm builds an optimal solution for this problem. It has two variants, ...
0
votes
1
answer
58
views
Faster, indexed, heuristic doubly-linked list data structure in Java: unit tests
Here I have the unit tests for the indexed doubly-linked list.
It goes like this:
...
3
votes
1
answer
1k
views
Testing DAO Delete User
I have several Dao classes, including a UserDao, below. The DAOs have many methods, but I'm focussing on deleteUser:
...
0
votes
1
answer
423
views
Unit tests for User class with JUnit 5
This is a follow-up question for Android app class serialization. Some problems have been mentioned in forsvarir's answer. Then, I am following JUnit 5 User Guide to redesign the test cases for ...
2
votes
1
answer
100
views
Android app class serialization
I am attempting to build an Android APP with the custom serializable class User. The public method Save is to save class ...
0
votes
2
answers
1k
views
Need Feedback on JUnit test comparing two timestamps
I am writng a JUnit test case for the below methods :
...
3
votes
2
answers
306
views
Replace words from a file with words from a dictionary based file
I'm working on a coding challenge that tasks me with taking a file with a dictionary, reading from it, and then replacing the matching words from the input file with what is found in the dictionary.
I ...
1
vote
1
answer
92
views
What to test on a rest API?
I created a rest controller with Spring Boot, I am trying to learn what I should write on my tests, right now I only check status codes and keys existence. I am planning to build an API to showcase at ...
1
vote
1
answer
175
views
Binary Search recursive & iterative solution
I have implemented binary search solution by using recursion and iterative approach.
I there any way to improve it?
Tests
...
4
votes
2
answers
244
views
Sanity check a simple RPG character
I'm writing an assistant for the tabletop RPG Pathfinder in Java. I intend to use the MVVM pattern using JavaFX, possibly through mvvmFX. Before I go into the V-VM phase, I have built a first ...