Advertisement
cepxuozab

PersonBehaviorTest

Apr 3rd, 2024
713
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.90 KB | None | 0 0
  1. void PersonBehaviorTest() {
  2.         Person p("ivan"s, 17);
  3.         ASSERT_EQUAL(p.GetDanceCount(), 0);
  4.         ASSERT_EQUAL(p.GetSatisfaction(), 100);
  5.  
  6.         p.LiveADay();
  7.         ASSERT_EQUAL(p.GetDanceCount(), 0);
  8.         ASSERT_EQUAL(p.GetSatisfaction(), 100);
  9.  
  10.         p.Dance();
  11.         ASSERT_EQUAL(p.GetDanceCount(), 1);
  12.         ASSERT_EQUAL(p.GetSatisfaction(), 100 + 1);
  13.         p.LiveADay();
  14.         ASSERT_EQUAL(p.GetDanceCount(), 1);
  15.         ASSERT_EQUAL(p.GetSatisfaction(), 100 + 1);
  16.  
  17.         p.Dance();
  18.         p.Dance();
  19.         ASSERT_EQUAL(p.GetDanceCount(), 3);
  20.         ASSERT_EQUAL(p.GetSatisfaction(), 100 + 3);
  21.         p.LiveADay();
  22.         ASSERT_EQUAL(p.GetDanceCount(), 3);
  23.         ASSERT_EQUAL(p.GetSatisfaction(), 100 + 3);
  24.  
  25.         const auto& p_c = p;
  26.         ASSERT_EQUAL(p_c.GetDanceCount(), 3);
  27.         ASSERT_EQUAL(p_c.GetSatisfaction(), 100 + 3);
  28.     }
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement