public async Task GetUsers_Should_Return_JsonResult()
        {
            this.Arrange();

            CurrentlyLoggedInUsersSingleton.AddNewEntry("user", "user-id");
            CurrentlyLoggedInUsersSingleton.AddNewEntry("second-user", "second-user-id");

            var result = await this.userController.GetUsers();

            this.Annihilate();

            Assert.IsType <JsonResult>(result);
        }
        private async Task <IActionResult> GetToken(TokenRequestViewModel model)
        {
            try
            {
                Token refreshToken = await this.tokenService.CreateUserRefreshToken(model.username, model.password, model.client_id);

                CurrentlyLoggedInUsersSingleton.AddNewEntry(model.username, refreshToken.UserId);

                TokenResponseViewModel tokenResponse = this.CreateAccessToken(refreshToken.UserId, refreshToken.Value, model.username);

                return(Json(tokenResponse));
            }
            catch (VideoChatWebAppMainException e) when(e is UserNotFoundException || e is UserPasswordMissmatchException)
            {
                return(new UnauthorizedResult());
            }
        }
        public async Task GetUsers_Should_Return_All_Users_Except_The_Current_User()
        {
            this.Arrange();

            CurrentlyLoggedInUsersSingleton.AddNewEntry("username", "user-id");
            CurrentlyLoggedInUsersSingleton.AddNewEntry("second-user", "second-user-id");

            var actionResult = await this.userController.GetUsers();

            this.Annihilate();

            JsonResult result = actionResult as JsonResult;

            List <string> usernames = result.Value as List <string>;

            Assert.Single(usernames);
            Assert.Equal("second-user", usernames.ElementAt(0));
        }