public string DeleteCurrentInternship(string internshipId) { InternshipService _internshipService = new InternshipService(settings); _internshipService.DeleteInternship(internshipId); return("Deleted!"); }
public void UpdateCurrentInternship(string id, Internship internshipIn) { Internship internship = internshipIn; InternshipService _internshipService = new InternshipService(settings); _internshipService.UpdateInternship(id, internshipIn); }
public void InitiallyContainsThreeMembers() { // Assume var intershipService = new InternshipService(); // Act // Assert Assert.Equal(3, intershipService.GetMembers().Count); }
public InternshipController(StudentService studentService, InternshipService internshipService, CompanyService companyService, PostService postService, ApplicationService applicationService) { _internshipService = internshipService; _companyService = companyService; _postService = postService; _studentService = studentService; _applicationService = applicationService; }
public StatisticsController(StatisticsService statisticsService, InternshipService internshipService, StudentService studentService, CompanyService companyService, RatingService ratingService) { _statisticsService = statisticsService; _internshipService = internshipService; _studentService = studentService; _companyService = companyService; _ratingService = ratingService; }
public StudentController(StudentService studentService, ApplicationService applicationService, InternshipService internshipService, SubscriptionService subscriptionService, RatingService ratingService, UserManager <ApplicationUser> userManager, RoleManager <IdentityRole> roleManager) { _studentService = studentService; _applicationService = applicationService; _internshipService = internshipService; _subscriptionService = subscriptionService; _ratingService = ratingService; _userManager = userManager; _roleManager = roleManager; }
public void WhenAddMemberItShouldBeThere() { // Assume var intershipService = new InternshipService(); Intern intern = new Intern(); // Act intern.Name = "Marko"; intershipService.AddMember(intern); // Assert Assert.Equal(4, intershipService.GetMembers().Count); Assert.Contains("Marko", intershipService.GetMembers().Select(member => member.Name)); }
public void TestGetIntershipById() { // arrange var id = 1; var intershipService = new InternshipService(_intershipRepository); var intershipRepositoryResult = getIntershipRepositoryResult(); _intershipRepository.Get(id).Returns(intershipRepositoryResult); // act var result = intershipService.GetById(id); // assert Assert.AreEqual(expected: intershipRepositoryResult, actual: result); }
public void CreateAnIntership(string company, string position, string paid, string city, string email, string description) { InternshipService _internshipService = new InternshipService(settings); Internship internship = new Internship(); internship.City = city; internship.Company = company; internship.Position = position; internship.Paid = paid; internship.Email = email; internship.Description = description; _internshipService.CreateInternship(internship); }
public static Application ToActualObject(ApplicationViewModel applicationViewModel, InternshipService internshipService) { return(new Application() { InternshipId = applicationViewModel.InternshipId, StudentId = applicationViewModel.StudentId, Status = applicationViewModel.Status }); }
public HomeController(ILogger <HomeController> logger, InternshipService intershipService) { _logger = logger; this.intershipService = intershipService; }
public Internship GetUserInternships(string internshipId) { InternshipService _internshipService = new InternshipService(settings); return(_internshipService.GetInternship(internshipId)); }
public void Setup() { _context = ContextHelper.GetDatabaseContext(); sut = new InternshipService(_context); dto = new InternshipCreationDto { RequiredFieldsOfStudy = new List <string>(), AssignedStudents = new List <string>(), Environment = new List <string>(), TechnicalDescription = "TechnicalDescription", ExtraRequirements = "ExtraRequirements", ResearchTheme = "ResearchTheme", Activities = new List <string>(), RequiredStudentsAmount = 2, AdditionalRemarks = "AdditionalRemarks", PeriodOfInternship = new List <string>(), Description = "Description" }; for (int i = 0; i < 10; i++) { dto.RequiredFieldsOfStudy.Add("ReqFOS" + i); dto.AssignedStudents.Add("AssignedStudent" + i); dto.Environment.Add("Environment" + i); dto.Activities.Add("Activity" + i); dto.PeriodOfInternship.Add("Period" + i); } internship = new Internship { CreatorId = Guid.NewGuid(), RequiredFieldsOfStudy = dto.RequiredFieldsOfStudy, AssignedStudents = dto.AssignedStudents, Environment = dto.Environment, TechnicalDescription = "TechnicalDescription", ExtraRequirements = "ExtraRequirements", ResearchTheme = "ResearchTheme", Activities = dto.Activities, RequiredStudentsAmount = 2, AdditionalRemarks = "AdditionalRemarks", Id = Guid.NewGuid(), InternshipState = 0, Periods = dto.PeriodOfInternship, Description = "Description", DateOfState = DateTime.UtcNow }; userTeacher = new User { Id = Guid.NewGuid(), City = "City", Email = "*****@*****.**", FirstName = "John", HouseNumber = 18, LastName = "Doe", PasswordHash = Guid.NewGuid().ToString(), PhoneNumber = "+3259874896", ZipCode = 7890, UserName = "******", StreetName = "Easy Street" }; userTeacher2 = new User { Id = Guid.NewGuid(), City = "City", Email = "*****@*****.**", FirstName = "John", HouseNumber = 18, LastName = "Doe", PasswordHash = Guid.NewGuid().ToString(), PhoneNumber = "+3259874896", ZipCode = 7890, UserName = "******", StreetName = "Easy Street" }; company = new Company { Id = internship.CreatorId }; ReviewerInternships reviewerInternships = new ReviewerInternships { ReviewedInternship = internship, Reviewer = userTeacher }; reviewerList = new List <ReviewerInternships> { reviewerInternships }; internship.Reviewers = reviewerList; IFCDto = new InternshipFeedbackCoordinatorDto { Feedback = "coordinator", InternshipId = internship.Id, ReviewedState = InternshipState.ApprovedByAll }; IFTDto = new InternshipFeedbackTeacherDto { Feedback = "teacher", InternshipId = internship.Id, TeacherId = userTeacher.Id }; updateDto = new InternshipUpdate { ID = internship.Id, ResearchTheme = "ResearchTheme", Description = "DescriptionUpdate", Activities = new List <string>() { "test" }, AdditionalRemarks = "test", AssignedStudents = new List <string>() { "Jan" }, Environment = new List <string>() { "test" }, ExtraRequirements = "test", PeriodOfInternship = new List <string>() { "test" }, RequiredFieldsOfStudy = new List <string>() { "AON" }, RequiredStudentsAmount = 1, TechnicalDescription = "test", Title = "test" }; _context.Add(reviewerInternships); _context.Add(userTeacher); _context.Add(internship); _context.SaveChanges(); }