Example #1
0
 public void TestEnrollANewProgram()
 {
     gymanager = Factory.CreateGyManagerForTests();
     int n = gymanager.GetNumberOfMembersOnAProgram("Yoga");
     gymanager.EnrollANewProgram("Yoga", "2209990335110");
     Assert.AreEqual(n + 1, gymanager.GetNumberOfMembersOnAProgram("Yoga"));
 }
Example #2
0
 public void TestAddProgramAndInstructor()
 {
     gymanager = Factory.CreateGyManagerForTests();
     gymanager.AddProgramAndInstructor("Test program", 100, 30, "Testa", "Testić", "1234567891234", 1000);
     Assert.IsTrue(gymanager.ProgramExists("Test program"));
     Assert.IsTrue(gymanager.InstructorExists("1234567891234"));
 }
Example #3
0
 public void TestDeleteMember()
 {
     gymanager = Factory.CreateGyManagerForTests();
     gymanager.AddMember("Testa", "Testić", "1234567891234");
     gymanager.DeleteMember("1234567891234");
     Assert.IsFalse(gymanager.MemberExists("1234567891234"));
 }
Example #4
0
 public void TestFireAndHire()
 {
     gymanager = Factory.CreateGyManagerForTests();
     gymanager.AddProgramAndInstructor("Test program", 100, 30, "Testa", "Testić", "1234567891234", 1000);
     gymanager.FireInstructorAndHireAnother("1234567891234", "Testadva", "Testićdva", "1234567891232");
     Assert.IsFalse(gymanager.InstructorExists("1234567891234"));
     Assert.IsTrue(gymanager.InstructorExists("1234567891232"));
 }
Example #5
0
 public void TestPayMembershipAndSalary()
 {
     gymanager = Factory.CreateGyManagerForTests();
     int cr = gymanager.GetCashRegisterValue();
     int salary = gymanager.GetInstructorsSalary("1111111111110");
     gymanager.PaySalary("1111111111110");
     Assert.AreEqual(cr - salary, gymanager.GetCashRegisterValue());
     cr = gymanager.GetCashRegisterValue();
     int membership = gymanager.GetMembership("2209990335110");
     gymanager.PayMembership("2209990335110");
     Assert.AreEqual(cr + membership, gymanager.GetCashRegisterValue());
 }
Example #6
0
 public void TestHireAMember()
 {
     gymanager = Factory.CreateGyManagerForTests();
     gymanager.FireInstructorAndHireAnother("1111111111110", "Vlatka", "Pavišić", "2209990335110");
 }
Example #7
0
 public void TestEnrollAProgramTwice()
 {
     gymanager = Factory.CreateGyManagerForTests();
     gymanager.EnrollANewProgram("Yoga", "220999033110");
     gymanager.EnrollANewProgram("Yoga", "220999033110");
 }
Example #8
0
 public void TestDeleteAMemberThatDoesntExist()
 {
     gymanager = Factory.CreateGyManagerForTests();
     gymanager.DeleteMember("2209990335777");
 }
Example #9
0
 public void TestWrongProgramOrInstructor()
 {
     gymanager = Factory.CreateGyManagerForTests();
     gymanager.AddProgramAndInstructor("Aerobic", 120, 20, "Renata", "Sopek", "1111111111110", 1000);
 }
Example #10
0
 public void TestWrongJmbg()
 {
     gymanager = Factory.CreateGyManagerForTests();
     //gymanager.AddMember("Vlatka", "Pavišić", "220999033511a");
     //gymanager.AddMember("Vlatka", "Pavišić", "2209990335110");
     gymanager.AddMember("Vlatka", "Pavišić", "22099903351182918664");
 }
Example #11
0
 public void TestUnenrollAProgramThatMemberDidntEnroll()
 {
     gymanager = Factory.CreateGyManagerForTests();
     gymanager.UnenrollAProgram("Yoga", "220999033110");
 }
Example #12
0
 public void TestUnenrollAProgram()
 {
     gymanager = Factory.CreateGyManagerForTests();
     int n = gymanager.GetNumberOfMembersOnAProgram("Yoga");
     gymanager.UnenrollAProgram("Yoga", "1111111111116");
     Assert.AreEqual(n - 1, gymanager.GetNumberOfMembersOnAProgram("Yoga"));
 }