Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void StudentBehaviorWithSatisfactionSupervisor() {
- Student p("ivan"s, 17);
- SatisfactionSupervisor sup{105, 107};
- p.SetObserver(&sup);
- ASSERT_EQUAL(p.GetDanceCount(), 0);
- ASSERT_EQUAL(p.GetSatisfaction(), 100);
- ASSERT_EQUAL(p.GetKnowledgeLevel(), 0);
- p.LiveADay();
- ASSERT_EQUAL(p.GetDanceCount(), 10);
- ASSERT_EQUAL(p.GetSatisfaction(), 107);
- ASSERT_EQUAL(p.GetKnowledgeLevel(), 1);
- p.Dance();
- ASSERT_EQUAL(p.GetDanceCount(), 10 + 1);
- ASSERT_EQUAL(p.GetSatisfaction(), 107 + 1);
- ASSERT_EQUAL(p.GetKnowledgeLevel(), 1);
- p.LiveADay();
- ASSERT_EQUAL(p.GetDanceCount(), 10 + 1);
- ASSERT_EQUAL(p.GetSatisfaction(), 107 + 1 - 3);
- ASSERT_EQUAL(p.GetKnowledgeLevel(), 1 + 1);
- p.Dance();
- p.Dance();
- ASSERT_EQUAL(p.GetDanceCount(), 10 + 1 + 2);
- ASSERT_EQUAL(p.GetSatisfaction(), 107 + 1 - 3 + 2);
- ASSERT_EQUAL(p.GetKnowledgeLevel(), 1 + 1);
- p.Study();
- ASSERT_EQUAL(p.GetDanceCount(), 10 + 1 + 2 + 3);
- ASSERT_EQUAL(p.GetSatisfaction(), 107);
- ASSERT_EQUAL(p.GetKnowledgeLevel(), 1 + 1 + 1);
- const auto& p_c = p;
- ASSERT_EQUAL(p_c.GetDanceCount(), 10 + 1 + 2 + 3);
- ASSERT_EQUAL(p_c.GetSatisfaction(), 107);
- ASSERT_EQUAL(p_c.GetKnowledgeLevel(), 1 + 1 + 1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement