server: add unit tests

Make test coverage >= 90%

#1019 
I wanna match the `Start` and `Stop` function