public void Should_Be_Ok_When_Find_By_Accelaration_Id(int accelerationId) { var fakes = new Fakes(); var fakeService = fakes.FakeCandidateService().Object; var expected = fakeService.FindByAccelerationId(accelerationId). Select(x => fakes.Mapper.Map <CandidateDTO>(x)). ToList(); var controller = new CandidateController(fakeService, fakes.Mapper); var result = controller.GetAll(accelerationId: accelerationId); Assert.IsType <OkObjectResult>(result.Result); var actual = (result.Result as OkObjectResult).Value as List <CandidateDTO>; Assert.NotNull(actual); Assert.Equal(expected, actual, new CandidateDTOIdComparer()); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void DownloadTemplate_Click(object sender, DirectEventArgs e) { // init table var dataTable = new DataTable(); // adjust table dataTable.Rows.Add(); dataTable.Columns.Add(new DataColumn(EmployeeCode)); dataTable.Columns.Add(new DataColumn(FullName)); dataTable.Columns.Add(new DataColumn(TimeInterview)); // get record var records = CandidateController.GetAll(null, null, null, CandidateType.Interview, null, null, false, null, null); // fill employee name and code for (var i = 0; i < records.Count; i++) { dataTable.Rows.Add(); dataTable.Rows[i][EmployeeCode] = records[i].Code; dataTable.Rows[i][FullName] = records[i].FullName; } ExportToExcel(dataTable, "~/" + Constant.PathTemplate, ImportCandidateInterviewExcelFile); }