Add test cases for rocketchataccountsettings
AbandonedPublic

Authored by velurimithun on Dec 17 2017, 5:50 AM.

Details

Reviewers
mlaurent
Summary

Test all the default values and signals using QSignalSpy.
Assign and get verifications for methods in rocketchataccountsettings class.

Test Plan
  • Methods returning QString should return an empty string.
  • Check all the signals using QSIgnalSpy when they are triggered.
  • Add tests for all the set and get methods.

Diff Detail

Repository
R865 Ruqola
Lint
Lint Skipped
Unit
Unit Tests Skipped
velurimithun requested review of this revision.Dec 17 2017, 5:50 AM
velurimithun created this revision.
mlaurent added inline comments.Dec 17 2017, 8:55 AM
autotests/rocketchataccountsettingstest.cpp
41

create it on stack

53

split in other method

57

use new connect api

58

no I don't know if emitting signal will provide a valid signal :)

I need to know if when I assign a value it will be emit

mlaurent requested changes to this revision.Dec 17 2017, 11:23 AM
This revision now requires changes to proceed.Dec 17 2017, 11:23 AM
  • default userId fails after loadSettings() is called.
  • it seems like logout() doesn't emit a signal.
  • reference to a signal is used instead connect as used in typingnotificationtest.cpp

Please test "setAccountName"/accountName (assign/get value is the same)
Same for other settings

autotests/rocketchataccountsettingstest.cpp
25

Remove it.

33

coding style: new line after ()

39

REmove it

44

new line

50

Remove it

71

if it doesn't emit signal "SpyLoginStatus.count()" can't be equal to 1 no ?

> test failed no ?

86

Stack == create RocketChatAccount as "socketChatAccountSettings setting;
not using QStack :)

99

REmove it

velurimithun retitled this revision from defaultValues test case for rocketchataccountsettings to Add test cases for rocketchataccountsettings .
velurimithun edited the summary of this revision. (Show Details)
velurimithun edited the test plan for this revision. (Show Details)

Add tests for all methods in rocketchataccountsettings.

mlaurent added inline comments.Dec 17 2017, 6:33 PM
autotests/rocketchataccountsettingstest.cpp
81

create temps variable as const QString val = QStringLiteral("...")
do you can write setAccountName(val);

QCOMPARE(accountName(), val);

same for other methods

Pass QStringLiteral via temp variable for all the methods.

Done!

Thank you.

Regards.

Where is the full patch ?
Why you don't use arc diff for updating patch ?