File tree Expand file tree Collapse file tree 1 file changed +44
-2
lines changed Expand file tree Collapse file tree 1 file changed +44
-2
lines changed Original file line number Diff line number Diff line change 77//
88#include " gtest/gtest.h"
99
10- TEST ( NavigationTest, FirstDemo )
10+ #include < QString>
11+
12+ namespace
13+ {
14+ class NavigationTest : public ::testing::Test
15+ {
16+ protected:
17+ NavigationTest ()
18+ : m_name( " Fake Dialog" ), m_got_focus( false )
19+ {
20+ }
21+
22+ void GetFocus ()
23+ {
24+ m_got_focus = true ;
25+ }
26+ void LoseFocus ()
27+ {
28+ m_got_focus = false ;
29+ }
30+
31+ const QString m_name;
32+
33+ bool m_got_focus;
34+ };
35+
36+ TEST_F ( NavigationTest, NameIsFakeDialog )
1137{
12- EXPECT_EQ ( 2 , 2 );
38+ EXPECT_EQ ( m_name, QString ( " Fake Dialog " ) );
1339}
40+
41+ TEST_F ( NavigationTest, InitiallyLacksFocus )
42+ {
43+ EXPECT_EQ ( m_got_focus, false );
44+ }
45+
46+ TEST_F ( NavigationTest, GotFocus )
47+ {
48+ GetFocus ();
49+ EXPECT_EQ ( m_got_focus, true );
50+
51+ LoseFocus ();
52+ EXPECT_EQ ( m_got_focus, false );
53+ }
54+
55+ } // namespace
You can’t perform that action at this time.
0 commit comments