public async Task <IViewComponentResult> InvokeAsync() { if (_matchService.IsMatched()) { VeteranLawyerMatch match = await _matchService.GetMatchAsync(); if (!match.IsDateTimeApproved) { match.Lawyer.Availability = _matchService.GetLawyerAvailability(match.LawyerApplicationUserId); return(View("MatchStage1", match)); } else { return(View("MatchStage2", match)); } } else if (_matchService.IsInQueue()) { VeteranQueue queue = _matchService.GetQueueItem(); return(View("WaitingMatch", queue)); } else if (!_matchService.HasCompletedForm()) { return(View("NoForm")); } else { return(View()); // "Default" } }
/// <summary> /// Displays the veteran's profile with options to select libraries or start their intake form /// </summary> public async Task OnGetAsync() { Veteran veteran = await _veteranService.GetVeteranByPrincipalAsync(User); Libraries = await _libraryService.GetAllLibrariesForVeteranAsync(veteran.ApplicationUserId); Match = await _matchService.GetMatchAsync(); }
public void LocationSelected_TestingGetter_ReturnString() { // Arrange VeteranLawyerMatch n = new VeteranLawyerMatch(); // Act n.LocationSelected = "Library"; // Assert Assert.Equal("Library", n.LocationSelected); }
public void LawyerApplicationUserId_TestingGetter_ReturnString() { // Arrange VeteranLawyerMatch n = new VeteranLawyerMatch(); // Act n.LawyerApplicationUserId = "Veteran"; // Assert Assert.Equal("Veteran", n.LawyerApplicationUserId); }
public void LocationSelected_TestingSetter_ReturnString() { // Arrange VeteranLawyerMatch n = new VeteranLawyerMatch() { LocationSelected = "Lawyer" }; // Act n.LocationSelected = "Veteran"; // Assert Assert.Equal("Veteran", n.LocationSelected); }
public void IsLocationApproved_TestingSetter_ReturnBool() { // Arrange VeteranLawyerMatch n = new VeteranLawyerMatch() { IsLocationApproved = false }; // Act n.IsLocationApproved = true; // Assert Assert.True(n.IsLocationApproved); }
public void IsDateTimeApproved_TestingGetter_ReturnBool() { // Arrange VeteranLawyerMatch n = new VeteranLawyerMatch(); VeteranLawyerMatch parent = new VeteranLawyerMatch(); // Act n.IsDateTimeApproved = true; parent.IsDateTimeApproved = true; // Assert Assert.True(n.IsDateTimeApproved); Assert.True(parent.IsDateTimeApproved); }
public ModelVeteran() { _user = new ApplicationUser() { Id = "00000000-0000-0000-0000-000000000000", Email = "*****@*****.**", FirstName = "John", LastName = "Doe", MiddleInitial = "H", UserName = "******" }; _match = new VeteranLawyerMatch() { ID = 1, LawyerApplicationUserId = "1", Veteran = new Veteran(), Lawyer = new Lawyer(), VeteranApplicationUserId = "1", IsDateTimeApproved = true, IsLocationApproved = true, LocationSelected = "Library", }; }