unity
unity copied to clipboard
Tests
Some errors are sneaky (like #127) and lead to unexpected crashes. These errors and crashes could be easily avoided with unit tests. In the future, widget testing could also be implemented.
Additional context
-
flutter_test - https://docs.flutter.dev/testing
Added the Flutter Analysis/tests workflow. Now, every test under the test folder will run on every pull-request, merge or release.
Some of the unit tests are:
- [ ] API
- [ ]
checkServerCredentials- [ ] Version Mismatch error
- [ ] Successful response
- [ ]
getDevices - [ ]
getEvents - [ ]
ptz
- [ ]
- [ ] Downloads
- [ ] Correctly read persisted values
- [ ] Default download directory returns the correct value
- [ ] Download event if its file doesn't exist on initialization
- [ ] Correctly download event file
- [ ] Correctly delete an event and its file
- [ ] Correctly cancel a ongoing download
- [ ] Settings
- [ ] Correctly persist data
- [ ] Correctly read persisted data
- [ ] Other
- [ ] Correctly convert timezone-aware dates
- [ ] Find the correct device on
List<Server>.findDevice(<id>) - [ ] Correctly sort
Iterable<Device>.sortedaccording to the parameters