public async Task <IActionResult> PostCourse([FromBody] CoursePost request) { if (!await _em.Departments.ExisteAsync(request.DepartmentId)) { ModelState.AddModelError("DepartmentId", "This Department Doesn't exist"); } ConnectUser teacher = await _em.Users.GetAsync(request.TeacherId); if (teacher == null) { ModelState.AddModelError("TeacherId", "This Teacher Doesn't exist"); } if (teacher != null && teacher.Role != Roles.Teacher) { ModelState.AddModelError("TeacherId", "This User is not a Teacher"); } if (!ModelState.IsValid) { return(BadRequest(ModelState)); } Course course = _mapper.Map <Course>(request); await _em.Courses.AddAsync(course); await _em.FlushAsync(); CourseResponse courseResponse = _mapper.Map <CourseResponse>(course); return(CreatedAtAction(nameof(GetCourse), new { id = course.Id }, courseResponse)); }
public ViewResult AddCourse(CourseResponse courseResponse) { Repository.AddCResponse(courseResponse); ViewBag.Thanksmsg = "Course Details Successfully Saved, go to View page to view details."; return(View("Thankyou", courseResponse)); }
public void Execute(Guid id) { Course entity = _repository.GetByID(id); CourseResponse response = CourseAdapter.GetResponse(entity); _presenter.Notify(response); }
public async Task UpdateAsyncWhenIdIsCorrectReturnsCourseInstance() { // Arrange var mockUnitOfWork = GetDefaultUnitOfWorkRepositoryInstance(); var mockCourseRepository = GetDefaultCourseRepositoryInstance(); var mockCareerRepository = new Mock <ICareerRepository>(); var CourseId = 1; var course = new Course() { Id = 1, Name = "string", CareerId = 1 }; mockCourseRepository.Setup(r => r.FindById(CourseId)).Returns(Task.FromResult(course)); mockCourseRepository.Setup(r => r.Update(course)); var service = new CourseService(mockCourseRepository.Object, mockUnitOfWork.Object, mockCareerRepository.Object); // Act CourseResponse result = await service.UpdateAsync(CourseId, course); var resource = result.Resource; // Assert resource.Should().Equals(course); }
public async Task DeleteAsyncWhenInvalidIdReturnsCourseNotFoundResponse() { // Arrange var mockUnitOfWork = GetDefaultUnitOfWorkRepositoryInstance(); var mockCourseRepository = GetDefaultCourseRepositoryInstance(); var mockCareerRepository = new Mock <ICareerRepository>(); var CourseId = 1; var course = new Course() { Id = 1, Name = "string", CareerId = 1 }; mockCourseRepository.Setup(r => r.FindById(CourseId)).Returns(Task.FromResult <Course>(null)); mockCourseRepository.Setup(r => r.Remove(course)); var service = new CourseService(mockCourseRepository.Object, mockUnitOfWork.Object, mockCareerRepository.Object); // Act CourseResponse result = await service.DeleteAsync(CourseId); var message = result.Message; // Assert message.Should().Be("Course not found"); }
public static ScorecardState Create(CourseResponse courseResponseModel, params PlayerScores[] playerScores) { return(new () { CourseResponse = courseResponseModel, PlayerScores = playerScores.ToList(), }); }
public CourseResponse Get(int id) { CourseResponse response = new CourseResponse(); var resultDb = context.Course.Include(x => x.Subject).Include(x => x.User).FirstOrDefault(u => u.UserId == id); response = _mapper.Map <Course, CourseResponse>(resultDb); return(response); }
private CourseViewModel GetCourseViewModel(CourseResponse item) { return(new CourseViewModel() { ID = item.ID, Name = item.Name, Description = item.Description }); }
private CourseSelectViewModel GetCourseViewModel(CourseResponse item) { return(new CourseSelectViewModel() { ID = item.ID, Name = item.Name, Selected = false }); }
public static long?GetMoodleDisciplinaId ( this Disciplina item, AppConfiguration configuration, Modalidade modalidade, GetCourseByNameClient client = null, HttpClient httpClient = null ) { string disciplinaNome = GetNomeDisciplina(item, configuration, modalidade); long? moodleDisciplineId = MoodleFromToCache.GetCachedMoodleCourse(modalidade.IdModalidade, disciplinaNome); if (moodleDisciplineId.HasValue) { return(moodleDisciplineId.Value); } GetCourseByNameClient getClient = client; if (getClient == null) { getClient = new GetCourseByNameClient(); } if (httpClient != null) { getClient.AddHttpClient(httpClient); } getClient.AddBaseUrl(modalidade.MoodleUrl) .AddServiceUrl(modalidade.MoodleServiceUrl) .AddToken(modalidade.MoodleGetInfoServiceToken); GetByNameRequest request = new GetByNameRequest() { Name = item.DisciplinaNome }; Task <CourseResponse> task = getClient.Post(request); task.Wait(); CourseResponse response = task.Result; if (response?.Id > 0) { MoodleFromToCache.AddCourse(modalidade.IdModalidade, disciplinaNome, response.Id); } return(response?.Id); }
private async Task <ServiceResult <CourseResponse> > GetServiceResult(Course courseEntity, Dictionary <string, string[]> modelState, int result) { if (result > 0) { return(await GetCourse(courseEntity.Id)); } else { CourseResponse response = Mapper.Map <Course, CourseResponse>(courseEntity); return(new ServiceResult <CourseResponse> { Message = "There were errors saving Course.", ModelState = modelState, Data = response }); } }
/// <summary> /// 课程详情 /// <para>作 者:zhiwei.Tang</para> /// <para>创建时间:2018-09-15</para> /// </summary> /// <param name="courseId">课程编号</param> /// <returns>课程详情数据</returns> /// <exception cref="BussinessException"> /// 异常ID:1,异常描述:未获取到课程数据 /// </exception> public async Task <CourseResponse> GetCourseDetailsAsync(long courseId) { var course = await _courseRepository.Value.LoadTaskByCourseId(_companyId, courseId); if (course == null) { throw new BussinessException(ModelType.Default, 1); } CourseResponse courseResponse = AutoMapper.Mapper.Map <CourseResponse>(course); List <TblDatCourseLevel> courseLevel = new TblDatCourseLevelRepository() .Get(this._companyId) .Result .OrderBy(x => x.LevelCode) .ToList(); var courseLv = await new ViewCourseLevelMiddleRepository().Get(new List <long> { courseId }); foreach (var lv in courseLevel) { CourseLevelMiddleResponse courseLevelMiddle = new CourseLevelMiddleResponse(); ViewCourseLevelMiddle levelMiddle = courseLv.FirstOrDefault(x => x.CourseLevelId == lv.CourseLevelId); if (levelMiddle == null) { if (lv.IsDisabled) { continue; } courseLevelMiddle.CourseLevelId = lv.CourseLevelId; courseLevelMiddle.CourseLevelName = lv.LevelCnName; courseLevelMiddle.SAge = courseLevelMiddle.EAge = courseLevelMiddle.Duration = string.Empty; courseLevelMiddle.IsCheck = false; } else { courseLevelMiddle.CourseLevelId = lv.CourseLevelId; courseLevelMiddle.CourseLevelName = lv.LevelCnName; courseLevelMiddle.SAge = levelMiddle.BeginAge.ToString(); courseLevelMiddle.EAge = levelMiddle.EndAge.ToString(); courseLevelMiddle.Duration = levelMiddle.Duration.ToString(); courseLevelMiddle.IsCheck = true; } courseResponse.CourseLevels.Add(courseLevelMiddle); } return(courseResponse); }
public static double GetDistance(this CourseResponse courseResponse, double longitude, double latitude) { if (courseResponse.Name == "Testbanan") { return(0); } var d1 = courseResponse.Latitude * (Math.PI / 180.0); var num1 = courseResponse.Longitude * (Math.PI / 180.0); var d2 = latitude * (Math.PI / 180.0); var num2 = longitude * (Math.PI / 180.0) - num1; var d3 = Math.Pow(Math.Sin((d2 - d1) / 2.0), 2.0) + Math.Cos(d1) * Math.Cos(d2) * Math.Pow(Math.Sin(num2 / 2.0), 2.0); return(6376500.0 * (2.0 * Math.Atan2(Math.Sqrt(d3), Math.Sqrt(1.0 - d3)))); }
public ViewResult CourseForm(CourseResponse courseResponse) { // checks if it was possible to bind the incoming values from the request to the model // correctly and check if any specific validation rules were violated if (ModelState.IsValid) { //store the responses from the guests courseRepository.AddResponse(courseResponse); //pass responses to the Razer View page "SummeryPage") return(View("SummaryPage", courseResponse)); } else { //return to view if responses are not valid return(View()); } }
public CourseResponse Map(Course course) { if (course == null) { return(null); } var courseResponse = new CourseResponse { Id = course.Id, Name = course.Name, TaughtInSeason = course.CourseNavigation?.Name, TaughtBy = HelperMapper.BasicMap(course.Teacher), EnrolledPupils = course.PupilInCourse .Select(x => HelperMapper.BasicMap(x.Pupil)) }; return(courseResponse); }
public IHttpActionResult GetDataForYear(int year) { if (year < 1999 || year > DateTimeOffset.UtcNow.Year) { return(BadRequest("year not in valid range")); } this.Db.Configuration.ProxyCreationEnabled = false; // TODO: Invalid players might need to be added to this (no shows, etc) var yearDataWithPlayerForYear = this.Db.playeryeardatas.Include(p => p.player).AsNoTracking().Where(x => x.year.value == year).ToList(); var weeksForYear = this.Db.weeks.Where(w => w.year.value == year).Include(w => w.course).AsNoTracking().ToList(); var teamsForYear = this.Db.teams.AsNoTracking().Where(x => x.playeryeardatas.Any(y => y.year.value == year)).ToList(); var leaderboards = this.Db.leaderboards.AsNoTracking().ToList(); var pairings = this.Db.pairings.AsNoTracking().ToList(); var leaderBoardDataForYear = this.Db.leaderboarddatas.AsNoTracking().Where(x => x.year.value == year).ToList(); var courses = weeksForYear.Select(w => w.course).GroupBy(c => c.id).Select(g => g.First()); var teamMatchupsForYear = this.Db.teammatchups .Include(x => x.teams) .Include(x => x.matches) .Include("matches.results") .Where(x => x.week.year.value == year).ToList() .GroupBy(x => x.weekId, x => x, (key, value) => value.OrderBy(x => x.matchOrder)) .SelectMany(x => x); var dby = new DataByYear { PlayersForYear = yearDataWithPlayerForYear.Select(x => PlayerResponse.From(x)).ToList(), LeaderboardDataForYear = leaderBoardDataForYear.Select(x => LeaderBoardDataResponse.From(x)).ToList(), Leaderboards = leaderboards.Select(x => new LeaderBoardResponse(x)).ToList(), TeamsForYear = teamsForYear.Select(x => TeamResponse.From(x)).ToList(), TeamMatchups = teamMatchupsForYear.Select(x => TeamMatchupResponse.From(x)).ToList(), Courses = courses.Select(x => CourseResponse.From(x)).ToList(), Weeks = weeksForYear.Select(x => new WeekResponse(x)).ToList(), Pairings = pairings }; return(Ok(dby)); }
private CourseResponse CriarDisciplinaMoodle(Disciplina item, long moodleCategoryId) { CreateCourseClient client = CreateCourseClient; BuildMoodleClient(client, MoodleTokenType.OfficialMoodleApiFunctions); CourseRequest request = new CourseRequest() { CategoryId = moodleCategoryId, Fullname = item.DisciplinaNome, Shortname = item.ShortName, Visible = 1 }; Task <CourseResponse> task = client.Post(request); task.Wait(); LastUrl = client.LastUrl; CourseResponse response = task.Result; return(response); }
public GetCourseByIdQueryResponse(Guid messageId) : base(messageId) { Result = new CourseResponse(); }
private InternalMoodleData VerifyIfExistsOnMoodleAndCreateIfDont(Professor professor, Disciplina item) { //category long?moodleCategoryId = item.GetMoodleCursoId(ModalidadeAtual, GetCategoryByNameClient, HttpClient); if (!moodleCategoryId.HasValue) { CategoryResponse categoryResponse = CriarCursoMoodle(item); moodleCategoryId = categoryResponse?.Id; } if (moodleCategoryId.HasValue) { MoodleFromToCache.AddCategory(ModalidadeAtual.IdModalidade, item.CursoDescricao, moodleCategoryId.Value); } else { throw new MoodleDataNotExistsException($"O curso [{item.CursoDescricao}] não está cadastrado no MOODLE."); } // course long?moodleCourseId = item.GetMoodleDisciplinaId(Configuration, ModalidadeAtual, GetCourseByNameClient, HttpClient); if (!moodleCourseId.HasValue) { CourseResponse courseResponse = CriarDisciplinaMoodle(item, moodleCategoryId.Value); moodleCourseId = courseResponse?.Id; } if (moodleCourseId.HasValue) { MoodleFromToCache.AddCourse(ModalidadeAtual.IdModalidade, item.DisciplinaNome, moodleCourseId.Value); } else { throw new MoodleDataNotExistsException($"A disciplina [{item.DisciplinaNome}] não está cadastrada no MOODLE."); } //user long?moodleUserId = professor.GetMoodleUserId(ModalidadeAtual, GetUserByUsernameClient, HttpClient); if (!moodleUserId.HasValue) { UserResponse userResponse = CriarUsuarioMoodle(professor); moodleUserId = userResponse?.Id; } if (moodleUserId.HasValue) { MoodleFromToCache.AddUser(ModalidadeAtual.IdModalidade, professor.ProfessorCpf, moodleUserId.Value); } else { throw new MoodleDataNotExistsException($"O professor [{professor.ProfessorCpf} | {professor.ProfessorNome}] não está cadastrado no MOODLE."); } return(new InternalMoodleData() { MoodleCategoryId = moodleCategoryId.Value, MoodleCourseId = moodleCourseId.Value, MoodleUserId = moodleUserId.Value }); }
public void Notify(CourseResponse response) { _courseViewModel.ID = response.ID; _courseViewModel.Name = response.Name; _courseViewModel.Description = response.Description; }
public ScorecardState(CourseResponse courseResponse, IEnumerable <PlayerScores> playerScores) { CourseResponse = courseResponse; PlayerScores = playerScores.ToList(); }
public void NewScorecard(ComponentBase source, CourseResponse courseResponseModel) { ScorecardState = ScorecardState.Create(courseResponseModel); ScorecardState.StateChanged += ScorecardStateOnStateChanged; NotifyStateChange(source, nameof(ScorecardState)); }
public void GetCourses_valid() { #region Local var GetCoursesRequest getCoursesRequest = new GetCoursesRequest(); GetCoursesResponse getCoursesResponse = new GetCoursesResponse(); CourseResponse courseResponse = new CourseResponse(); Course[] Course = null; StringBuilder sbError = new StringBuilder(); string Test_Result_Upsert = String.Empty; #endregion try { for (int i = 0; i < 5; i++) { if (i == 0)//If Provided ContactCrmId has entitlement for the given ProductCrmId { getCoursesRequest.contactCrmId = ValidNonCebUser[0]; getCoursesRequest.productCrmId = ProductCrmId; } else if (i == 1)//method should return all the courses with in a given ProductCrmId(Course bundle) { getCoursesRequest.contactCrmId = null; getCoursesRequest.productCrmId = ProductCrmId; } else if (i == 2)//number of courses returned in response object of method is mapped with SFDC data { getCoursesRequest.contactCrmId = ValidNonCebUser[0]; getCoursesRequest.productCrmId = ProductCrmId; } try { getCoursesResponse = target.GetCourses(getCoursesRequest); courseResponse = getCoursesResponse.GetCoursesResult; if (courseResponse.Courses.Length > 0) { Course = courseResponse.Courses; } bool IsEntitledChk = true; if (i == 0 || i == 1) { //Validate Course having isentite true for (int j = 0; j < Course.Length; j++) { if (Course[j].IsEntitled == false) { IsEntitledChk = false; } } } //TODO: Call SFDC replica for validation of return courses if (i == 0) { Test_Result_Upsert = _Assert.Execute( () => _Assert.AssertTrue(getCoursesResponse != null, "getCoursesResponse return null", root), () => _Assert.AssertTrue(courseResponse.Courses.Length > 0, "courseResponse return count 0", root), () => _Assert.AssertTrue(IsEntitledChk == true, "IsEntitledChk return false against getcourse", root), () => _Assert.AssertTrue(Course[0].CourseCategory != null, "CourseCategory is null", root), () => _Assert.AssertTrue(Course[0].CourseCrmId != null, "CourseCrmId is null", root), () => _Assert.AssertTrue(Course[0].CourseName != null, "CourseName is null", root), () => _Assert.AssertTrue(Course[0].CourseNumber != null, "CourseNumber is null", root) ); if (Test_Result_Upsert == "") { if (i == 0) { _writer.WriteLog(serviceName, "GetCourses_valid|ContactCrmId::" + getCoursesRequest.contactCrmId + "|ProductCrmId::" + getCoursesRequest.productCrmId, DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString(), "Call GetCourses method If Provided ContactCrmId has entitlement for the given ProductCrmId than, IsEntitled response object is true ", SBWSCommon.StatusLevelOptions.PASS.ToString(), "To Verify that fields available while calling GetCourses Method CourseCategory[0]:" + Course[0].CourseCategory + "|CourseCrmId[0]:" + Course[0].CourseCrmId + "|CourseName[0]:" + Course[0].CourseName + "|CourseNumber[0]:" + Course[0].CourseNumber + "|IsEntitled response object is true", root); } } else { _writer.WriteLog(serviceName, "GetCourses_valid|ContactCrmId::" + getCoursesRequest.contactCrmId + "|ProductCrmId::" + getCoursesRequest.productCrmId, DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString(), "Call GetCourses method If Provided ContactCrmId has entitlement for the given ProductCrmId than, IsEntitled response object is true ", SBWSCommon.StatusLevelOptions.FAIL.ToString(), "To Verify that fields available while calling GetCourses Method CourseCategory[0]:" + Course[0].CourseCategory + "|CourseCrmId[0]:" + Course[0].CourseCrmId + "|CourseName[0]:" + Course[0].CourseName + "|CourseNumber[0]:" + Course[0].CourseNumber + "|IsEntitled response object is true|Error:" + Test_Result_Upsert, root); } } else if (i == 1) { Test_Result_Upsert = _Assert.Execute( () => _Assert.AssertTrue(getCoursesResponse != null, "getCoursesResponse return null", root), () => _Assert.AssertTrue(courseResponse.Courses.Length > 0, "courseResponse return count 0", root), () => _Assert.AssertTrue(IsEntitledChk == true, "IsEntitledChk return false against getcourse", root) ); if (Test_Result_Upsert == "") { _writer.WriteLog(serviceName, "GetCourses_valid|ContactCrmId::" + getCoursesRequest.contactCrmId + "|ProductCrmId::" + getCoursesRequest.productCrmId, DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString(), "Call GetCourses method should return all the courses with in a given ProductCrmId(Course bundle) ", SBWSCommon.StatusLevelOptions.PASS.ToString(), "To Verify that fields available while calling GetCourses Method | Course lenth:" + Course.Length, root); } else { _writer.WriteLog(serviceName, "GetCourses_valid|ContactCrmId::" + getCoursesRequest.contactCrmId + "|ProductCrmId::" + getCoursesRequest.productCrmId, DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString(), "Call GetCourses method should return all the courses with in a given ProductCrmId(Course bundle) ", SBWSCommon.StatusLevelOptions.FAIL.ToString(), "To Verify that fields available while calling GetCourses Method | Course lenth:" + Course.Length + "+Error:" + Test_Result_Upsert, root); } } else if (i == 2) { Test_Result_Upsert = _Assert.Execute( () => _Assert.AssertTrue(getCoursesResponse != null, "getCoursesResponse return null", root), () => _Assert.AssertTrue(courseResponse.Courses.Length > 0, "courseResponse return count 0", root), () => _Assert.AssertTrue(IsEntitledChk == true, "IsEntitledChk return false against getcourse", root) ); if (Test_Result_Upsert == "") { _writer.WriteLog(serviceName, "GetCourses_valid|ContactCrmId::" + getCoursesRequest.contactCrmId + "|ProductCrmId::" + getCoursesRequest.productCrmId, DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString(), "Call GetCourses method should return all the courses with in a given ProductCrmId(Course bundle) ", SBWSCommon.StatusLevelOptions.PASS.ToString(), "To Verify that fields available while calling GetCourses Method | Course lenth:" + Course.Length, root); } else { _writer.WriteLog(serviceName, "GetCourses_valid|ContactCrmId::" + getCoursesRequest.contactCrmId + "|ProductCrmId::" + getCoursesRequest.productCrmId, DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString(), "Call GetCourses method should return all the courses with in a given ProductCrmId(Course bundle) ", SBWSCommon.StatusLevelOptions.FAIL.ToString(), "To Verify that fields available while calling GetCourses Method | Course lenth:" + Course.Length + "+Error:" + Test_Result_Upsert, root); } } } catch (Exception ex0) { throw; } } } catch (Exception ex) { throw; } finally { getCoursesRequest = null; getCoursesResponse = null; } }
public void GetCourses_InValid() { #region Local var GetCoursesRequest getCoursesRequest = new GetCoursesRequest(); GetCoursesResponse getCoursesResponse = new GetCoursesResponse(); CourseResponse courseResponse = new CourseResponse(); Course[] Course = null; StringBuilder sbError = new StringBuilder(); string Test_Result_Upsert = String.Empty; string validationMessage = string.Empty; #endregion try { for (int i = 0; i < 8; i++) { if (i == 0)//if we are not providing any value in input field { validationMessage = ""; getCoursesRequest.contactCrmId = null; getCoursesRequest.productCrmId = null; } else if (i == 1)//contactCrmId field is optional { validationMessage = ""; getCoursesRequest.contactCrmId = null; getCoursesRequest.productCrmId = ProductCrmId; } else if (i == 2)//ProductCrmId field is mandatory { validationMessage = ""; getCoursesRequest.contactCrmId = ValidNonCebUser[0]; getCoursesRequest.productCrmId = null; } else if (i == 3)//invalid contactCrmId { validationMessage = ""; getCoursesRequest.contactCrmId = ValidNonCebUser[0] + "Invalid"; getCoursesRequest.productCrmId = ProductCrmId; } else if (i == 4)//invalid ProductCrmId { validationMessage = ""; getCoursesRequest.contactCrmId = ValidNonCebUser[0]; getCoursesRequest.productCrmId = ProductCrmId + "Invalid"; } else if (i == 5)//if we provide a contactCrmId of Unregistered or Ghost User { validationMessage = ""; getCoursesRequest.contactCrmId = ValidNonCebUser[0]; getCoursesRequest.productCrmId = ProductCrmId; } else if (i == 6)//IsEntitled is false in response object, if provided ProductCrmId and ContactCrmId not associated with each other { validationMessage = ""; getCoursesRequest.contactCrmId = ValidCebUser[0]; getCoursesRequest.productCrmId = ProductCrmId; } else if (i == 7)//ProductCrmID is Inactive { validationMessage = ""; getCoursesRequest.contactCrmId = ValidNonCebUser[0]; getCoursesRequest.productCrmId = ProductCrmId; } try { getCoursesResponse = target.GetCourses(getCoursesRequest); courseResponse = getCoursesResponse.GetCoursesResult; if (courseResponse.Courses.Length > 0) { Course = courseResponse.Courses; } bool IsEntitledChk = true; if (i == 0 || i == 1) { //Validate Course having isentite true for (int j = 0; j < Course.Length; j++) { if (Course[j].IsEntitled == false) { IsEntitledChk = false; } } } } catch (Exception ex0) { Test_Result_Upsert = _Assert.Execute( () => _Assert.AssertTrue(ex0.Message.Contains(validationMessage), "Validation message is not matched", root)); if (Test_Result_Upsert == "") { _writer.WriteLog(serviceName, "GetCourses_InValid|contactCrmId::" + getCoursesRequest.contactCrmId + "|productCrmId::" + getCoursesRequest.productCrmId, DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString(), "Call GetCourses method ", SBWSCommon.StatusLevelOptions.PASS.ToString(), "To Verify validation messages|Expected validation message:" + ex0.Message, root); } else { _writer.WriteLog(serviceName, "GetCourses_InValid|contactCrmId::" + getCoursesRequest.contactCrmId + "|productCrmId::" + getCoursesRequest.productCrmId, DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString(), "Call GetCourses method ", SBWSCommon.StatusLevelOptions.PASS.ToString(), "To Verify validation messages|Expected validation message:" + ex0.Message + "|Error:" + Test_Result_Upsert, root); } } } } catch (Exception ex) { throw; } finally { getCoursesRequest = null; getCoursesResponse = null; } }