private CaseProvider getBaseAide() { var subject = new CaseProvider(); subject.Provider = new Providers.Provider(); subject.Provider.ProviderType = new Providers.ProviderType(); subject.Provider.ProviderType.Code = "AIDE"; return(subject); }
public void SupervisorRoleReturnsFalseIfNotBCBA() { CaseProvider subject = getBaseAide(); subject.IsSupervisor = true; bool result = subject.VerifyRoles(DateTime.Now); Assert.IsFalse(result); }
public void AuthorizedBCBAReturnsFalseIfNotBCBA() { CaseProvider subject = getBaseAide(); subject.IsAuthorizedBCBA = true; bool result = subject.VerifyRoles(DateTime.Now); Assert.IsFalse(result); }
public List <CaseAuthorizationHours> GetCaseHoursByCaseByProvider(int caseID, int providerID, DateTime?cutoffDate = null) { var context = new Models.CoreEntityModel(); IQueryable <Models.CaseAuthHour> q; if (cutoffDate == null) { q = (from auths in context.CaseAuthCodes join hours in context.CaseAuthHours on auths.ID equals hours.CaseAuthID where auths.CaseID == caseID && hours.CaseProviderID == providerID select hours) .Union( from hours in context.CaseAuthHours where hours.CaseID == caseID && hours.CaseProviderID == providerID select hours ); } else { q = (from auths in context.CaseAuthCodes join hours in context.CaseAuthHours on auths.ID equals hours.CaseAuthID where auths.CaseID == caseID && hours.CaseProviderID == providerID && hours.HoursDate >= cutoffDate.Value select hours) .Union( from hours in context.CaseAuthHours where hours.CaseID == caseID && hours.CaseProviderID == providerID && hours.HoursDate >= cutoffDate.Value select hours ); } var providerHours = q.ToList(); var list = Mappings.AuthorizationMappings.CaseAuthorizationHours(providerHours); var services = GetServices(); var providerService = new ProviderService(); foreach (var hours in list) { hours.Service = services.Where(x => x.ID == hours.Service.ID).FirstOrDefault(); var provider = providerService.GetProvider(hours.ProviderID); Domain.Cases.CaseProvider cp = new CaseProvider(); cp.FirstName = provider.FirstName; cp.LastName = provider.LastName; hours.Provider = cp; } return(list); }
public void AuthorizedBCBARoleFailsIfMoreThanOneAuthorizedBCBA() { CaseProvider subject = getBaseVerifyRoles(); subject.Case.Providers.First().IsAuthorizedBCBA = true; subject.IsAuthorizedBCBA = true; bool results = subject.VerifyRoles(DateTime.Now); Assert.IsFalse(results); }
public void SupervisorRolesFailsIfMoreThanOneSupervisor() { CaseProvider subject = getBaseVerifyRoles(); subject.Case.Providers.First().IsSupervisor = true; subject.IsSupervisor = true; bool results = subject.VerifyRoles(DateTime.Now); Assert.IsFalse(results); }