Example #1
0
        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"
            }
        }
Example #2
0
        /// <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();
        }
Example #3
0
        public void LocationSelected_TestingGetter_ReturnString()
        {
            // Arrange
            VeteranLawyerMatch n = new VeteranLawyerMatch();

            // Act
            n.LocationSelected = "Library";
            // Assert
            Assert.Equal("Library", n.LocationSelected);
        }
Example #4
0
        public void LawyerApplicationUserId_TestingGetter_ReturnString()
        {
            // Arrange
            VeteranLawyerMatch n = new VeteranLawyerMatch();

            // Act
            n.LawyerApplicationUserId = "Veteran";

            // Assert
            Assert.Equal("Veteran", n.LawyerApplicationUserId);
        }
Example #5
0
        public void LocationSelected_TestingSetter_ReturnString()
        {
            // Arrange
            VeteranLawyerMatch n = new VeteranLawyerMatch()
            {
                LocationSelected = "Lawyer"
            };

            // Act
            n.LocationSelected = "Veteran";

            // Assert
            Assert.Equal("Veteran", n.LocationSelected);
        }
Example #6
0
        public void IsLocationApproved_TestingSetter_ReturnBool()
        {
            // Arrange
            VeteranLawyerMatch n = new VeteranLawyerMatch()
            {
                IsLocationApproved = false
            };

            // Act
            n.IsLocationApproved = true;

            // Assert
            Assert.True(n.IsLocationApproved);
        }
Example #7
0
        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);
        }
Example #8
0
        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",
            };
        }