Ejemplo n.º 1
0
        public void GetUsernameByInvalidUuid()
        {
            UsernameRequest usernameRequest = new UsernameRequest("foobar");

            usernameRequest = usernameRequest.SendRequest() as UsernameRequest;

            Assert.False(usernameRequest?.WasSuccessful);
        }
Ejemplo n.º 2
0
        public void GetUsername()
        {
            UsernameRequest usernameRequest = new UsernameRequest("689b94ff553b4c179e662e0865b12dcb");

            usernameRequest = usernameRequest.SendRequest() as UsernameRequest;

            Assert.AreEqual("dedepete", usernameRequest?.Username);
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> AddFriend([FromBody] UsernameRequest username)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            GenericResponse <BooleanResponse> res = await _userBusiness.AddFriend(HttpContext.GetCurrentUserId(), username.Username);

            return(this.GetResultFromResponse(res));
        }
 public string Any(UsernameRequest request)
 {
     return(((System.Security.Principal.IPrincipal)HostContext.Instance.Items["User"]).Identity.Name);
 }