public void TestInitialize() { this.service = new TeacherServerService(); }
public void TestCleanup() { this.service = null; }
/// <summary> /// Updates a teacher. /// </summary> /// <param name="itemToSave">The item to save.</param> /// <returns>The result.</returns> public ResultDto UpdateTeacher(TeacherEditDto itemToSave) { this.SetResponseHeaderCacheExpiration(); AccountPassword credentials = this.GetCredentialsFromRequest(); AccountServerService accountService = new AccountServerService(); Guid accountId = accountService.GetAccountId(credentials.Account); TeacherServerService service = new TeacherServerService(); return service.UpdateTeacher(itemToSave, accountId); }
/// <summary> /// Deletes a teacher. /// </summary> /// <param name="idToDelete">The identifier.</param> /// <returns>The result.</returns> public ResultDto DeleteTeacher(IdDto idToDelete) { this.SetResponseHeaderCacheExpiration(); AccountPassword credentials = this.GetCredentialsFromRequest(); AccountServerService accountService = new AccountServerService(); Guid accountId = accountService.GetAccountId(credentials.Account); TeacherServerService service = new TeacherServerService(); return service.DeleteTeacher(idToDelete.Id, accountId); }
/// <summary> /// Returns the teacher lookup. /// </summary> /// <returns>The teacher lookup.</returns> public List<TeacherLookupDto> GetTeacherLookup() { this.SetResponseHeaderCacheExpiration(); AccountPassword credentials = this.GetCredentialsFromRequest(); AccountServerService accountService = new AccountServerService(); Guid accountId = accountService.GetAccountId(credentials.Account); TeacherServerService service = new TeacherServerService(); return service.GetTeacherLookup(accountId); }