public void AddUniversityTest() { UniversityAppService target = new UniversityAppService(); University university = University.CreateUniversity(universityId, "上海测试大学", "普通高校", "无", "上海市福州路1号", false, true, false, "上海市", "上海市"); target.AddUniversity(university); using (UniversityRepository repository = new UniversityRepository()) { var createdUniversity = repository.Get(universityId); Assert.AreNotEqual(createdUniversity, null); Assert.AreEqual(createdUniversity.Name, "上海测试大学"); } }
public void AddSpecialityTest() { UniversityAppService target = new UniversityAppService(); Speciality speciality = Speciality.CreateSpeciality(specialityId, "计算机", "理科", new Guid("D4FCA237-DA28-4B30-B357-0005CE66716A"), "工学","电气信息类", 4); target.AddSpeciality(speciality); UniversityRepository repository = new UniversityRepository(); var university = repository.Get(speciality.UniversityId); var createdSpeciality = university.Specialities.SingleOrDefault<Speciality>(s => s.Id == specialityId); Assert.AreNotEqual(createdSpeciality, null); Assert.AreEqual(createdSpeciality.Id, specialityId); }
public UniversityController() { universityService = new UniversityAppService(); regionService = new RegionAppService(); provinces = regionService.GetFiltered(r => r.Class == 1); var universityTypeCollection = Enum.GetNames(typeof(UniversityType)); universityTypes = new Dictionary<string, string>(); foreach (var universityType in universityTypeCollection) universityTypes.Add(universityType, universityType); schoolTypes = new Dictionary<string, string>(); var schoolTypeCollection = Enum.GetNames(typeof(SchoolType)); foreach (var schoolType in schoolTypeCollection) schoolTypes.Add(schoolType, schoolType); }
public void UpdateUniversityTest() { UniversityAppService target = new UniversityAppService(); using (UniversityRepository repository = new UniversityRepository()) { var university = repository.Get(new Guid("AA1E7B07-3701-41FC-9291-D742B9E17DDE"));//universityId); university.Email = "*****@*****.**"; target.UpdateUniversity(university); repository.Refresh(university); Assert.AreEqual(university.Email, "*****@*****.**"); } }
public void UpdateEnrollPlanTest() { UniversityAppService target = new UniversityAppService(); // TODO: Initialize to an appropriate value UniversityEnrollPlan enrollPlan = null; // TODO: Initialize to an appropriate value target.UpdateEnrollPlan(enrollPlan); Assert.Inconclusive("A method that does not return a value cannot be verified."); }
public void UpdateSpecialityTest() { UniversityAppService target = new UniversityAppService(); // TODO: Initialize to an appropriate value Speciality speciality = null; // TODO: Initialize to an appropriate value target.UpdateSpeciality(speciality); Assert.Inconclusive("A method that does not return a value cannot be verified."); }
public void RemoveUniversityTest() { UniversityAppService target = new UniversityAppService(); // TODO: Initialize to an appropriate value Guid universityId = new Guid(); // TODO: Initialize to an appropriate value target.RemoveUniversity(universityId); Assert.Inconclusive("A method that does not return a value cannot be verified."); }
public void GetByUniversityIdTest() { UniversityAppService target = new UniversityAppService(); // TODO: Initialize to an appropriate value Guid universityId = new Guid(); // TODO: Initialize to an appropriate value IEnumerable<SpecialityDTO> expected = null; // TODO: Initialize to an appropriate value IEnumerable<SpecialityDTO> actual; actual = target.GetSpecialitiesByUniversityId(universityId); Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); }
public void GetAllTest() { UniversityAppService target = new UniversityAppService(); IList<University> actual; actual = target.GetAll(); Assert.AreEqual(3158, actual.Count); }
public UserController() { userService = new UserAppService(); regionService = new RegionAppService(); universityService = new UniversityAppService(); }
public void CreateApplicationTest() { ApplicationService target = new ApplicationService(); UniversityAppService universitySerivce = new UniversityAppService(); ApplicationRepository appRepository = new ApplicationRepository(); var app = appRepository.Get(new Guid("6079D394-C27A-4871-996A-AC9374097042")); if (app != null) { appRepository.Remove(app); appRepository.Commit(); app = appRepository.Get(new Guid("6079D394-C27A-4871-996A-AC9374097042")); Assert.AreEqual(app, null); } GF.Domain.Context.Application application = new Domain.Context.Application(new Guid("D1111C18-A0BD-480B-99CA-AAF50B2D1818"), new Guid("408AD727-5E75-409C-A658-0AB0C6A9EFD2"), new Guid("6079D394-C27A-4871-996A-AC9374097042")); target.CreateApplication(application); app = appRepository.Get(new Guid("6079D394-C27A-4871-996A-AC9374097042")); Assert.AreNotEqual(app, null); Assert.AreEqual(app.Id, new Guid("6079D394-C27A-4871-996A-AC9374097042")); }