[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdepimlibs/kcal/tests
From:       Allen Winter <winter () kde ! org>
Date:       2009-01-21 23:45:17
Message-ID: 1232581517.649950.27768.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 914883 by winterz:

add unit tests for Person::fullName()


 M  +14 -1     testperson.cpp  
 M  +2 -1      testperson.h  


--- trunk/KDE/kdepimlibs/kcal/tests/testperson.cpp #914882:914883
@@ -1,6 +1,6 @@
 /*
   This file is part of the kcal library.
-  Copyright (C) 2006 Allen Winter <winter@kde.org>
+  Copyright (C) 2006-2009 Allen Winter <winter@kde.org>
 
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
@@ -50,3 +50,16 @@
   QVERIFY( person3.name() == "fred" );
   QVERIFY( person3.email() == "fred@flintstone.com" );
 }
+
+void PersonTest::testStringify()
+{
+  Person person1( "fred", "fred@flintstone.com" );
+  Person person2( "wilma", "wilma@flintstone.com" );
+  QVERIFY( person1.fullName() == "fred <fred@flintstone.com>" );
+  QVERIFY( person2.fullName() == "wilma <wilma@flintstone.com>" );
+
+  person1.setName( "" );
+  QVERIFY( person1.fullName() == "fred@flintstone.com" );
+  person1.setEmail( QString() );
+  QVERIFY( person1.fullName() == QString() );
+}
--- trunk/KDE/kdepimlibs/kcal/tests/testperson.h #914882:914883
@@ -1,6 +1,6 @@
 /*
   This file is part of the kcal library.
-  Copyright (c) 2006 Allen Winter <winter@kde.org>
+  Copyright (c) 2006-2009 Allen Winter <winter@kde.org>
 
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
@@ -29,6 +29,7 @@
   private Q_SLOTS:
     void testValidity();
     void testCompare();
+    void testStringify();
 };
 
 #endif
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic