IOS-937 testIdentityRatingMistrustUndo
authorDirk Zimmermann <dirk@pep-project.org>
Fri, 09 Feb 2018 15:51:11 +0100
changeset 4453027e25306ea
parent 444 2a0cd682d1f7
child 446 70bb6386c76f
IOS-937 testIdentityRatingMistrustUndo
pEpObjCTests/PEPSessionTest.m
     1.1 --- a/pEpObjCTests/PEPSessionTest.m	Fri Feb 09 15:47:17 2018 +0100
     1.2 +++ b/pEpObjCTests/PEPSessionTest.m	Fri Feb 09 15:51:11 2018 +0100
     1.3 @@ -183,6 +183,31 @@
     1.4      XCTAssertEqual([session identityRating:alice], PEP_rating_reliable);
     1.5  }
     1.6  
     1.7 +- (void)testIdentityRatingMistrustUndo
     1.8 +{
     1.9 +    PEPSession *session = [PEPSession new];
    1.10 +
    1.11 +    PEPIdentity *me = [self
    1.12 +                       checkMySelfImportingKeyFilePath:@"6FF00E97_sec.asc"
    1.13 +                       address:@"pep.test.alice@pep-project.org"
    1.14 +                       userID:@"Alice_User_ID"
    1.15 +                       fingerPrint:@"4ABE3AAF59AC32CFE4F86500A9411D176FF00E97"];
    1.16 +    XCTAssertEqual([session identityRating:me], PEP_rating_trusted_and_anonymized);
    1.17 +
    1.18 +    PEPIdentity *alice = [self
    1.19 +                          checkImportingKeyFilePath:@"6FF00E97_sec.asc"
    1.20 +                          address:@"pep.test.alice@pep-project.org"
    1.21 +                          userID:@"This Is Alice"
    1.22 +                          fingerPrint:@"4ABE3AAF59AC32CFE4F86500A9411D176FF00E97"];
    1.23 +    XCTAssertEqual([session identityRating:alice], PEP_rating_reliable);
    1.24 +
    1.25 +    [session keyMistrusted:alice];
    1.26 +    XCTAssertEqual([session identityRating:alice], PEP_rating_have_no_key);
    1.27 +
    1.28 +    [session undoLastMistrust];
    1.29 +    XCTAssertEqual([session identityRating:alice], PEP_rating_reliable);
    1.30 +}
    1.31 +
    1.32  - (void)testOutgoingColors
    1.33  {
    1.34      PEPSession *session = [PEPSession new];