-
Notifications
You must be signed in to change notification settings - Fork 9
Testing
We have written several tests to ensure code quality and to detect possible infections. You can find our tests here.
We use the so-called TDLib (C-library) to communicate with Telegram. By using it we want to ensure that everything works correctly and we have unterstood the usage of the TDLib. This is why we want to test it. But because of authentication-reasons (MFA) we are not able to automate tests by using a normal telegram account. Instead, we use the Test Data Center provided by Telegram.
Telegram uses serveral datacenters to manage their data. One of them is a datacenter which is used for development reasons. It accepts specific pairs of phone number and authentication code which will not change. With these codes you will be able to automate your tests.
We use the following specification:
phonenumber: '9996621234'
authenticationcode: '22222'
An other option would be to create a Mock-Client that mimics interaction with TDLib. This would be more resource efficient, but does not completely simulate a real environment. We decided to always test using telegram test data center to verify our understanding of the TDLib interface. This turned out very useful in early stages but may be changed in further revisions of the project for faster testing.
We currently are not testing the UI yet, this will be a task for the next group. We focused on providing a well crafted Core to interact with, which is tested and provides a minimal UI. Also notice that the core is completely independent from the UI and could be changed easily.