mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-30 06:12:20 -06:00
Bazaar: GTest examples renamed.
git-svn-id: svn://ultimatepp.org/upp/trunk@15003 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
830036a2e8
commit
8158a053c4
12 changed files with 2 additions and 2 deletions
51
bazaar/GTestExample/StringTest.cpp
Normal file
51
bazaar/GTestExample/StringTest.cpp
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
#include "StringTest.h"
|
||||
|
||||
namespace Upp {
|
||||
|
||||
void StringTest::SetUp()
|
||||
{
|
||||
sCat = "Cat";
|
||||
sDog = "Dog";
|
||||
}
|
||||
|
||||
TEST_F(StringTest, TestDefaultConstructor)
|
||||
{
|
||||
String a;
|
||||
|
||||
ASSERT_EQ(a, "");
|
||||
}
|
||||
|
||||
TEST_F(StringTest, TestConstructor)
|
||||
{
|
||||
String a("Test");
|
||||
ASSERT_EQ(a, "Test");
|
||||
}
|
||||
|
||||
TEST_F(StringTest, TestGetCount)
|
||||
{
|
||||
ASSERT_EQ(sEmpty.GetCount(), 0);
|
||||
ASSERT_EQ(sCat.GetCount(), 3);
|
||||
ASSERT_EQ(sDog.GetCount(), 3);
|
||||
}
|
||||
|
||||
TEST_F(StringTest, TestClear)
|
||||
{
|
||||
sCat.Clear();
|
||||
|
||||
ASSERT_EQ(sCat, "");
|
||||
ASSERT_EQ(sCat.GetCount(), 0);
|
||||
}
|
||||
|
||||
TEST_F(StringTest, TestCompare)
|
||||
{
|
||||
ASSERT_EQ(sCat.Compare(sCat), 0);
|
||||
ASSERT_EQ(sCat.Compare(sDog), -1);
|
||||
}
|
||||
|
||||
TEST_F(StringTest, TestEqual)
|
||||
{
|
||||
ASSERT_TRUE(sCat.IsEqual(sCat));
|
||||
ASSERT_FALSE(sCat.IsEqual(sDog));
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue