Exemplo n.º 1
0
        public void Init()
        {
            _trainerManager = new TrainerManager();
            _eventManager = new EventManager();

            _trainer1 = new Trainer()
            {
                Id = 1,
                FirstName = "Test FirstName 9",
                LastName = "Test LastName 9",
                Email = "*****@*****.**",
                PhoneNo = "99119911",
                Description = "A description 9"
            };

            _trainer2 = new Trainer()
            {
                Id = 2,
                FirstName = "Test FirstName 10"
            };
            _trainer3 = new Trainer()
            {
                Id = 3,
                FirstName = "Test FirstName 11"
            };
        }
Exemplo n.º 2
0
        public void Test_Delete_in_trainerManager_after_Create()
        {
            _trainer2 = _trainerManager.Create(_trainer2);
            Assert.AreNotEqual(null, _trainer2);

            var isDeleted = _trainerManager.Delete(_trainer2);
            Assert.AreEqual(true, isDeleted);
        }
Exemplo n.º 3
0
 public void Test_not_Deleting_a_Trainer_in_trainerManager()
 {
     //Id 50 is not existing in the Database. We remake the Database with a new seed every time the application runs.
     //The default amound of trainers is 3.
     int noneExistingId = 50;
     var _trainer = new Trainer()
     {
         Id = noneExistingId,
         FirstName = "Bobby",
         LastName = "Stein",
         Description = "This trainer will not update"
     };
     var isDeleted = _trainerManager.Delete(_trainer);
     Assert.AreEqual(false, isDeleted);
 }
Exemplo n.º 4
0
        public void Init()
        {
            _eventManager = new EventManager();
            _trainerManager = new TrainerManager();

            var _trainer1 = new Trainer()
            {
                Id = 1, Description = "Test Disc1", Email = "*****@*****.**", FirstName = "Test First Name 1",
                LastName = "Test Last Name 1", PhoneNo = "11224455"
            };
            _event1 = new Event() {Title = "Test title 1", Description = "Disc 1", Id = 1, Date = DateTime.Now};
            _event1.Trainers.Add(_trainer1);
            _trainer1.Events.Add(_event1);

            _event2 = new Event() {Title = "Test title 2", Description = "Disc 2", Id = 1};

            _event3 = new Event() {Description = "Disc 3", Title = "Test title 3"};
        }
Exemplo n.º 5
0
 public void Test_not_Updating_a_Trainer_in_trainerManager()
 {
     //Id 50 is not existing in the Database. We remake the Database with a new seed every time the application runs.
     //The default amound of trainers is 3.
     int noneExistingId = 50;
     var _trainer = new Trainer()
     {
         Id = noneExistingId,
         FirstName = "Huggo",
         LastName = "Boss",
         Description = "This trainer will not update"
     };
     _trainer = _trainerManager.Update(_trainer);
     Assert.AreEqual(noneExistingId, _trainer.Id);
 }
Exemplo n.º 6
0
        public void Test_ReadById_in_trainerManager_after_Create()
        {
            _trainer1 = _trainerManager.Create(_trainer1);
            Assert.AreNotEqual(null, _trainer1);

            int id = _trainerManager.ReadByID(_trainer1.Id).Id;
            Assert.AreEqual(_trainer1.Id, id);
        }