public UniversityInfo(int course, Specialty spec, University uni, Faculty fac)
 {
     this.Course = course;
     this.Specialty = spec;
     this.University = uni;
     this.Faculty = fac;
 }
 public Student(string firstName, string middleName, string lastName, string ssn, string address, string phoneNumber,
     string email, int? course, Specialty specialtyName, Faculty facultyName, University universityName)
     : this(firstName, middleName, lastName, ssn)
 {
     this.Address = address;
     this.PhoneNumber = phoneNumber;
     this.Email = email;
     this.Course = course;
     this.SpecialtyName = specialtyName;
     this.FacultyName = facultyName;
     this.UniversityName = universityName;
 }
 public Student(string firstName, char middleName, string lastName, long ssn, string adress, long phoneNumber, string email, string course, Specialty specialty, University university, Facylty faculty)
 {
     this.Specialty = specialty;
     this.University = university;
     this.Faculty = faculty;
     this.FirstName = firstName;
     this.MiddleName = middleName;
     this.LastName = lastName;
     this.Ssn = ssn;
     this.Adress = adress;
     this.PhoneNumber = phoneNumber;
     this.Email = email;
     this.Course = course;
 }
 public Student(string firstName, string middleName, string lastName, string address, uint phone, byte course, int ssn, 
     Specialty specialty, University university, Faculty faculty)
 {
     this.FirstName = firstName;
     this.MiddleName = middleName;
     this.LastName = lastName;
     this.Address = address;
     this.Phone = phone;
     this.Course = course;
     this.SSN = ssn;
     this.Specialty = specialty;
     this.University = university;
     this.Faculty = faculty;
 }
 public Student(string firstName, string secondName, string lastName, string permanentAddress, int SSN, int mobilePhone,
                 string email, string course, Specialty spec, University uni, Faculty fac)
 {
     this.firstName = firstName;
     this.secondName = secondName;
     this.lastName = lastName;
     this.SSN = SSN;
     this.mobilePhone = mobilePhone;
     this.permanentAddress = permanentAddress;
     this.email = email;
     this.course = course;
     this.spec = spec;
     this.uni = uni;
     this.fac = fac;
 }
Exemple #6
0
 public Student(string firstName, string middleName, string lastName, string SSN, string address, string mobilePhone,
                string email, string course, Specialty speciality, University university, Faculty faculty)
 {
     this.FirstName = firstName;
     this.MiddleName = middleName;
     this.LastName = lastName;
     this.SSN = SSN;
     this.PermanentAddress = address;
     this.MobilePhone = mobilePhone;
     this.Email = email;
     this.Course = course;
     this.Specialty = speciality;
     this.University = university;
     this.Faculty = faculty;
 }
Exemple #7
0
        public ActionResult AddSpecialty(string name, string description, string image)
        {
            Specialty specialty = new Specialty
                                      {
                                          Name = name,
                                          Description = description,
                                          IsActive = false,
                                          Image = image
                                      };

            MenuService menuService = new MenuService();
            menuService.AddSpecialty(specialty);

            return RedirectToAction("ListDishes");
        }
Exemple #8
0
 public Student(string firstName, string middleName, string lastName, decimal ssn,
                string address, string mobilePhone, string email, int course,
                Specialty specialty, University university, Faculty faculty)
 {
     this.FirstName = firstName;
     this.MiddleName = middleName;
     this.LastName = lastName;
     this.SSN = ssn;
     this.Address = address;
     this.MobilePhone = mobilePhone;
     this.Email = email;
     this.Course = course;
     this.Specialty = specialty;
     this.University = university;
     this.Faculty = faculty;
 }
Exemple #9
0
 protected Ship(int damage, int health, int shields, int energy, int speed, int specialtyDamage, Specialty specialty)
 {
     this.Damage = damage;
     this.Health = health;
     this.Shields = shields;
     this.previousSpeed = speed;
     this.MAX_SPEED = speed + (int)BonusType.Wind;
     this.Speed = speed;
     this.Energy = energy;
     this.specialtyDamage = specialtyDamage;
     this.FreezTimeOut = new Stopwatch();
     this.BonusDamageTimeOut = new Stopwatch();
     this.WindTimeOut = new Stopwatch();
     this.specialty = specialty;
     this.FrameSize = new Point(137, 150);
 }
Exemple #10
0
        public Student(string firstName, string lastName, int ssn, Specialty SpecialtyStudent, University UniversityStudent, Faculty FacultyStudent,
            string course = null, string addres = null, string mobilePhone = null,
            string email = null, string middleName = null)
        {
            this.FirstName = firstName;
            this.MiddleName = middleName;
            this.LastName = lastName;
            this.SSN = ssn;
            this.Address = addres;
            this.MobilePhone = mobilePhone;
            this.Email = email;
            this.Course = course;

            this.SpecialtyStudent = SpecialtyStudent;
            this.UniversityStudent = UniversityStudent;
            this.FacultyStudent = FacultyStudent;
        }
Exemple #11
0
        public Student(string name1, string name2, string name3, int SSN, string address, string mobile, string email,
            University uni, Faculty fac, Specialty spec, string course)
        {
            this.NameFirst = name1;
            this.NameMiddle = name2;
            this.NameLast = name3;
            this.SSN = SSN;
            this.Address = address;
            this.Mobile = mobile;
            this.EMail = email;
            this.University = uni;
            this.Faculty = fac;
            this.Speciality = spec;
            this.Course = course;


        }
        public void GetSpecialties_RetrievesAllSpecialtiesWithStylist_SpecialtyList()
        {
            //Arrange, Act
            Stylist testStylist = new Stylist("perm");

            testStylist.Save();
            Specialty firstSpecialty = new Specialty("Larry");

            firstSpecialty.Save();
            Specialty secondSpecialty = new Specialty("barry");

            secondSpecialty.Save();
            testStylist.AddSpecialty(firstSpecialty);
            testStylist.AddSpecialty(secondSpecialty);
            List <Specialty> testSpecialtyList = new List <Specialty> {
                firstSpecialty, secondSpecialty
            };
            List <Specialty> resultSpecialtyList = testStylist.GetSpecialties();

            //Assert
            CollectionAssert.AreEqual(testSpecialtyList, resultSpecialtyList);
        }
Exemple #13
0
        public void Delete_A_Specific_Specialty()
        {
            //Arrange
            Specialty testSpecialty = new Specialty("Yoko");

            testSpecialty.Save();
            Specialty testSpecialty2 = new Specialty("Jon");

            testSpecialty2.Save();

            //Act
            testSpecialty.Delete();
            List <Specialty> expectedList = new List <Specialty> {
                testSpecialty2
            };

            //Assert
            List <Specialty> outputList = Specialty.GetAll();

            Assert.IsTrue(outputList.Count == 1);
            CollectionAssert.AreEqual(expectedList, outputList);
        }
        public List <Specialty> GetAllSpecialties()
        {
            var result = new List <Specialty>();

            try
            {
                _connection.Open();

                var cmd = new SqlCommand(@"
                                            SELECT
                                                [id],
                                                [code],
                                                [name]
                                            FROM
                                                [Specialty]
                                            WHERE
                                                [isDeleted] = 'False'
                                            ", _connection);
                using (var reader = cmd.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        var specialty = new Specialty
                        {
                            Id   = reader.GetInt32(0),
                            Code = reader.GetString(1),
                            Name = reader.GetString(2)
                        };
                        result.Add(specialty);
                    }
                }
            }
            finally
            {
                _connection.Close();
            }

            return(result);
        }
Exemple #15
0
        public void AddSpecialty_AddsEntryToJunctionTable_ListSpecialties()
        {
            //arrange
            Specialty newSpecialty = new Specialty("Cutting Hair");

            newSpecialty.Save();
            Stylist newStylist = new Stylist("Carol", "Smith");

            newStylist.Save();

            //act
            newStylist.AddSpecialty(newSpecialty);
            List <Specialty> testList = new List <Specialty> {
                newSpecialty
            };
            List <Specialty> result = newStylist.GetSpecialties();

            Console.WriteLine(result.Count);

            //assert
            CollectionAssert.AreEqual(testList, result);
        }
        public async Task <IActionResult> OnGetAsync()
        {
            try {
                string userId = User.Identity.Name;                                       // Gets the current logged email
                currentUser = _context.Technician.FirstOrDefault(x => x.Email == userId); // Gets from context the Client with that email
            } catch (Exception e) {
                Console.WriteLine("Something went wrong getting the logged user: "******"https://localhost:5001/"));
            }

            if (currentUser == null)
            {
                return(RedirectToPage("https://localhost:5001/"));
            }

            Specialty = currentUser.Specialty;

            Requirements = await _context.Requirement
                           .Where(r => r.Specialty == currentUser.Specialty).Include(r => r.Project).ToListAsync();

            return(Page());
        }
        public void AddaStylistToASpecialty()
        {
            //Arrange
            Stylist testStylist = new Stylist("Peter");

            testStylist.Save();

            Specialty testSpecialty = new Specialty("Color");

            testSpecialty.Save();

            //Act
            testStylist.AddSpecialty(testSpecialty);

            List <Specialty> result   = testStylist.GetSpecialties();
            List <Specialty> testList = new List <Specialty> {
                testSpecialty
            };

            //Assert
            CollectionAssert.AreEqual(testList, result);
        }
        public bool EditSpecialInfo(int id, String name)
        {
            bool      ret       = false;;
            Specialty specialty = null;

            if (id > 0)
            {
                specialty      = DBThesis.Specialty.FirstOrDefault(f => f.Id == id);
                specialty.Name = name;
            }
            else
            {
                specialty      = new Specialty();
                specialty.Name = name;
                DBThesis.Specialty.Add(specialty);
            }
            if (DBThesis.SaveChanges() > 0)
            {
                ret = true;
            }
            return(ret);
        }
        public override void Generate()
        {
            var facultyIds = this.Context.Faculties.Select(e => e.Id).ToArray();

            for (int i = 0; i < facultyIds.Length; i++)
            {
                var facultyId = facultyIds[i];

                for (int index = 0; index < this.Count; index++)
                {
                    var title = this.Generator.GenerateString(2, 20);

                    var specialty = new Specialty()
                    {
                        Title     = title,
                        FacultyId = facultyId
                    };

                    this.Context.Specialties.Add(specialty);
                }
            }
        }
Exemple #20
0
        public void AddSpecialty_AddsSpecialtyToStylist_SpecialtyList()
        {
            //Arrange
            Stylist testStylist = new Stylist("first", "last");

            testStylist.Save();

            Specialty testSpecialty = new Specialty("Hair Cut");

            testSpecialty.Save();

            //Act
            testStylist.AddSpecialty(testSpecialty.GetSpecialtyId());

            List <Specialty> result   = testStylist.GetSpecialties();
            List <Specialty> testList = new List <Specialty> {
                testSpecialty
            };

            //Assert
            CollectionAssert.AreEqual(testList, result);
        }
Exemple #21
0
        public void GetStylists_RetrievesAllStylistsWithSpecialtyId_StylistList()
        {
            // Arrange
            Specialty testSpecialty = new Specialty("testSpecialty");

            testSpecialty.Save();
            Stylist testStylist = new Stylist("testStylist");

            testStylist.Save();
            StylistSpecialty testStylistSpecialty = new StylistSpecialty(testStylist.GetId(), testSpecialty.GetId());

            testStylistSpecialty.Save();
            List <Stylist> testStylists = new List <Stylist> {
                testStylist
            };

            // Act
            List <Stylist> resultStylists = testSpecialty.GetStylists();

            // Assert
            CollectionAssert.AreEqual(testStylists, resultStylists);
        }
Exemple #22
0
        public void AddStylist_AddsStylistToSpecialty_StylistList()
        {
            //Arrange
            Specialty testSpecialty = new Specialty("stylist");

            testSpecialty.Save();

            Stylist testStylist = new Stylist("Joe");

            testStylist.Save();

            //Act
            testSpecialty.AddStylist(testStylist);

            List <Stylist> result   = testSpecialty.GetStylists();
            List <Stylist> testList = new List <Stylist> {
                testStylist
            };

            //Assert
            CollectionAssert.AreEqual(testList, result);
        }
        public void GetStylists_GetsListOfStylists_StylistList()
        {
            string    name      = "Foils";
            Specialty specialty = new Specialty(name);

            specialty.Save();

            string  firstName   = "Sylvia";
            string  lastName    = "Green";
            string  phoneNumber = "206-555-6789";
            Stylist stylist     = new Stylist(firstName, lastName, phoneNumber);

            stylist.Save();
            specialty.AddStylist(stylist);

            List <Stylist> expected = new List <Stylist> {
                stylist
            };
            List <Stylist> actual = specialty.GetStylists();

            CollectionAssert.AreEqual(expected, actual);
        }
        private void RefreshSpecialtyForSearchProperty()
        {
            SpecialtiesForSearch.Clear();

            try
            {
                Specialty item0 = new Specialty {
                    Id = 0, Name = DafaultConstant.DefaultSpecialty
                };
                SpecialtiesForSearch.Add(item0);
                Specialties.ToList().ForEach(x => SpecialtiesForSearch.Add(x));
                OnPropertyChanged(nameof(SpecialtiesForSearch));
            }
            catch (EntityException e)
            {
                OnEntityException(e);
            }
            catch (DbEntityValidationException e)
            {
                OnDbEntityValidationException(e);
            }
        }
        public ActionResult AddSpecialty([Bind(Include = "spcID, spcName")] Specialty specialty)
        {
            ViewBag.FullName = getUserName();
            try
            {
                var alreadyExists = db.Specialties.Any(u => u.spcName == specialty.spcName);


                if ((ModelState.IsValid) && !(alreadyExists))
                {
                    db.Specialties.Add(specialty);
                    db.SaveChanges();
                    return(RedirectToAction("Create"));
                }
            }
            catch (DataException)
            {
                ModelState.AddModelError("", "Unable to save changes.Try again, and if the problem persists see your system administrator.");
            }

            return(RedirectToAction("Create", "AdminDashboard"));
        }
Exemple #26
0
        public ActionResult UpdatePost(int id, int newClientId, int newSpecialtyId)
        {
            Stylist editStylist = Stylist.Find(id);
            string  name        = Request.Form["new-name"];
            int     experience  = int.Parse(Request.Form["new-exp"]);

            editStylist.Edit(name, experience);

            if (newClientId > 0)
            {
                Client newClient = Client.Find(newClientId);
                editStylist.AddClient(newClient);
            }

            if (newSpecialtyId > 0)
            {
                Specialty newSpecialty = Specialty.Find(newSpecialtyId);
                editStylist.AddSpecialty(newSpecialty);
            }

            return(RedirectToAction("ViewAll"));
        }
Exemple #27
0
        public ActionResult Edit(SpecialtyEditViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(RedirectToAction("Index", "Error"));
            }
            var entity = new Specialty
            {
                SpecialtyId = model.SpecialtyId,
                CourseId    = model.CourseId,
                Name        = model.SpecialtyName
            };

            if (entity.SpecialtyId != 0)
            {
                _specialtyService.Update(entity);
                _historyService.Insert(new History
                {
                    Email    = AuthHelper.GetUser(HttpContext).Email,
                    Action   = Action.Update,
                    DateTime = DateTime.Now,
                    Entity   = EntityEnum.Speciality
                });
            }
            else
            {
                _specialtyService.Insert(entity);
                _historyService.Insert(new History
                {
                    Email    = AuthHelper.GetUser(HttpContext).Email,
                    Action   = Action.Create,
                    DateTime = DateTime.Now,
                    Entity   = EntityEnum.Speciality
                });
            }
            _unitOfWork.SaveChanges();

            return(RedirectToAction("Index"));
        }
        public void Delete_DeletesSpecialtyAssociations_SpecialtyList()
        {
            //Arrange
            Stylist testStylist = new Stylist("Tim");

            testStylist.Save();

            Specialty testSpecialty = new Specialty("James");

            testSpecialty.Save();

            //Act
            testSpecialty.AddStylist(testStylist);
            testSpecialty.Delete();

            List <Specialty> resultStylistSpecialties = testStylist.GetSpecialties();
            List <Specialty> testStylistSpecialties   = new List <Specialty> {
            };

            //Assert
            CollectionAssert.AreEqual(resultStylistSpecialties, testStylistSpecialties);
        }
Exemple #29
0
        public void GetSpecialties_RetrievesAllSpecialtiesWithStylistId_SpecialtyList()
        {
            // Arrange
            Stylist testStylist = new Stylist("testStylist");

            testStylist.Save();
            Specialty testSpecialty = new Specialty("testSpecialty");

            testSpecialty.Save();
            StylistSpecialty testStylistSpecialty = new StylistSpecialty(testStylist.GetId(), testSpecialty.GetId());

            testStylistSpecialty.Save();
            List <Specialty> testSpecialties = new List <Specialty> {
                testSpecialty
            };

            // Act
            List <Specialty> resultSpecialties = testStylist.GetSpecialties();

            // Assert
            CollectionAssert.AreEqual(testSpecialties, resultSpecialties);
        }
        public List <Specialty> GetAll()
        {
            var specialties = new List <Specialty>();

            try
            {
                _connection.Open();
                var cmd = new SqlCommand(
                    @"
                        SELECT 
                            [id], [code], [name]
                        FROM
                            [Specialities]
                    ",
                    _connection
                    );

                using (var reader = cmd.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        var spec = new Specialty
                        {
                            Id   = reader.GetInt32(0),
                            Code = reader.GetString(1),
                            Name = reader.GetString(2)
                        };

                        specialties.Add(spec);
                    }
                }
            }
            finally
            {
                _connection.Close();
            }

            return(specialties);
        }
 public ResponseModel Save(Specialty entity)
 {
     if (entity.Valid)
     {
         _uow.SpecialtyRepository.Add(entity);
         return(new ResponseModel
         {
             Data = entity,
             Status = Domain.DataContext.Enums.EResultStatus.Success,
             Message = "Especialidade cadastrada com sucesso"
         });
     }
     else
     {
         return(new ResponseModel
         {
             Status = Domain.DataContext.Enums.EResultStatus.Failure,
             Message = "Falha ao tentar cadastradar especialidade",
             Notifications = entity.Notifications
         });
     }
 }
        public void GetStylists_RetrievesAllStylistsWithSpecialty_StylistList()
        {
            //Arrange, Act
            Specialty testSpecialty = new Specialty("perm");

            testSpecialty.Save();
            Stylist firstStylist = new Stylist("Larry");

            firstStylist.Save();
            Stylist secondStylist = new Stylist("barry");

            secondStylist.Save();
            testSpecialty.AddStylist(firstStylist);
            testSpecialty.AddStylist(secondStylist);
            List <Stylist> testStylistList = new List <Stylist> {
                firstStylist, secondStylist
            };
            List <Stylist> resultStylistList = testSpecialty.GetStylists();

            //Assert
            CollectionAssert.AreEqual(testStylistList, resultStylistList);
        }
        public async Task <ActionResult> Create([Bind(Include = "Id,Title,ParentId,Description")] Specialty specialty)
        {
            if (specialty.ParentId == 0)
            {
                specialty.ParentId = null;
            }
            if (ModelState.IsValid)
            {
                db.Specialties.Add(specialty);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            var specialties = new SelectList(db.Specialties.Where(x => x.ParentId == null), "Id", "Title").ToList();

            specialties.Insert(0, new SelectListItem()
            {
                Text = "هیچکدام", Value = "0"
            });
            ViewBag.ParentId = specialties;
            return(View(specialty));
        }
        public void AddDoctor_AddsDoctorToSpecialty_DoctorList()
        {
            //Arrange
            Specialty testSpecialty = new Specialty("Therapist");

            testSpecialty.Save();

            Doctor testDoctor = new Doctor("Joe");

            testDoctor.Save();

            //Act
            testSpecialty.AddDoctor(testDoctor);

            List <Doctor> result   = testSpecialty.GetDoctors();
            List <Doctor> testList = new List <Doctor> {
                testDoctor
            };

            //Assert
            CollectionAssert.AreEqual(testList, result);
        }
Exemple #35
0
        public void Delete_DeleteOneSpecialtyInDatabase_True()
        {
            //Arrange
            Specialty        firstSpecialty  = new Specialty("Wu");
            Specialty        secondSpecialty = new Specialty("Yu");
            List <Specialty> testList        = new List <Specialty> {
                secondSpecialty
            };

            firstSpecialty.Save();
            secondSpecialty.Save();

            //Act
            int firstId = firstSpecialty.GetId();

            firstSpecialty.Delete(firstId);
            List <Specialty> compareList = Specialty.GetAll();

            Console.WriteLine(compareList.Count);
            //Assert
            Assert.AreEqual(testList.Count, compareList.Count);
        }
Exemple #36
0
            public override IDeepCopyable CopyTo(IDeepCopyable other)
            {
                var dest = other as PractitionerRoleComponent;

                if (dest != null)
                {
                    base.CopyTo(dest);
                    if (ManagingOrganization != null)
                    {
                        dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopy();
                    }
                    if (Role != null)
                    {
                        dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy();
                    }
                    if (Specialty != null)
                    {
                        dest.Specialty = new List <Hl7.Fhir.Model.CodeableConcept>(Specialty.DeepCopy());
                    }
                    if (Period != null)
                    {
                        dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy();
                    }
                    if (Location != null)
                    {
                        dest.Location = new List <Hl7.Fhir.Model.ResourceReference>(Location.DeepCopy());
                    }
                    if (HealthcareService != null)
                    {
                        dest.HealthcareService = new List <Hl7.Fhir.Model.ResourceReference>(HealthcareService.DeepCopy());
                    }
                    return(dest);
                }
                else
                {
                    throw new ArgumentException("Can only copy to an object of the same type", "other");
                }
            }
Exemple #37
0
        private void mButtonEdit_Click(object sender, RoutedEventArgs e)
        {
            string title = mFieldTitle.Text;

            if (title == null || title.Equals(""))
            {
                MessageBox.Show("Укажите фамилию!", "Ошибка!", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }

            // Сохранение экземпляра таблицы в переменной
            Specialty specialty = tableModel[index].Specialty_Object;

            specialty.Title = title;

            int rowNum = tableModel[index].Row_Number;

            // Удаление старой записи
            tableModel.RemoveAt(index);

            // Создание обновленной модели
            SpecialtyModel specialtyModel = new SpecialtyModel();

            specialtyModel.Row_Number       = rowNum;
            specialtyModel.Specialty_Object = specialty;

            // Запись обновленной модели в GUI таблицу
            tableModel.Insert(index, specialtyModel);

            // Выборка записи таблицы из БД
            var specialtyBD = dbContext.Specialties.First(d => d.Specialty_Id == specialtyModel.Specialty_Object.Specialty_Id);

            // Изменение информации в строке
            specialtyBD.Title = title;

            // Сохранение изменений в БД
            dbContext.SaveChanges();
        }
Exemple #38
0
        public async Task Update(Specialty specialty)
        {
            if (specialty == null)
            {
                throw new ValidationException("Data was not received");
            }

            if (await _specialtyRepository.GetById(specialty.Id) == null)
            {
                throw new ValidationException("Specialty was not found");
            }

            var tempSpecialty = await GetSpecialtyByName(specialty.Name);

            if (tempSpecialty != null && tempSpecialty.Id != specialty.Id)
            {
                throw new ValidationException("Specialty with that name already exist");
            }

            var specialtyDTO = _mapper.Map <Specialty, SpecialtyDTO>(specialty);

            await _specialtyRepository.Update(specialtyDTO);
        }
Exemple #39
0
        public void GetAll_ReturnsAllSpecialtyObjects_SpecialtyList()
        {
            //Arrange
            string    specialty1    = "Colorist";
            Specialty newSpecialty1 = new Specialty(specialty1);

            newSpecialty1.Save();

            string    specialty2    = "Barber";
            Specialty newSpecialty2 = new Specialty(specialty2);

            newSpecialty2.Save();

            List <Specialty> newList = new List <Specialty> {
                newSpecialty1, newSpecialty2
            };

            //Act
            List <Specialty> result = Specialty.GetAll();

            //Assert
            CollectionAssert.AreEqual(newList, result);
        }
        public void GetSpecialties_ReturnsAllStylistSpecialties_SpecialtyList()
        {
            //Arrange
            Stylist testStylist = new Stylist("test stylist");

            testStylist.Save();
            Specialty testSpecialty1 = new Specialty("test description1");

            testSpecialty1.Save();
            Specialty testSpecialty2 = new Specialty("test description2");

            testSpecialty2.Save();

            //Act
            testStylist.AddSpecialty(testSpecialty1);
            List <Specialty> savedSpecialties = testStylist.GetSpecialties();
            List <Specialty> testList         = new List <Specialty> {
                testSpecialty1
            };

            //Assert
            CollectionAssert.AreEqual(testList, savedSpecialties);
        }
        public void Delete_DeletesSpecialtyAssociationsFromDatabase_SpecialtyList()
        {
            //Arrange
            Doctor testDoctor = new Doctor("Jim");

            testDoctor.Save();

            string    testDescription = "Leg";
            Specialty testSpecialty   = new Specialty(testDescription);

            testSpecialty.Save();

            //Act
            testSpecialty.AddDoctor(testDoctor);
            testSpecialty.Delete();

            List <Specialty> resultDoctorSpecialtys = testDoctor.GetSpecialtys();
            List <Specialty> testDoctorSpecialtys   = new List <Specialty> {
            };

            //Assert
            CollectionAssert.AreEqual(testDoctorSpecialtys, resultDoctorSpecialtys);
        }
Exemple #42
0
 public Programmer(string name, Specialty specialty)
 {
     Name = name;
     Specialty = specialty;
 }
Exemple #43
0
 public void AddSpecialty(Specialty specialty)
 {
     SpecialtyRepository specialtyRepository = new SpecialtyRepository();
     specialtyRepository.Add(specialty);
 }
Exemple #44
0
 protected void AddSpecialty(Specialty specialtyToAdd)
 {
     this.specialtiesList.Add(specialtyToAdd);
 }