AspNet.Security.OAuth.Validation.Tests.OAuthValidationMiddlewareTests.ValidTokenAllowsSuccessfulAuthentication C# (CSharp) Method

ValidTokenAllowsSuccessfulAuthentication() private method

private ValidTokenAllowsSuccessfulAuthentication ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task
        public async Task ValidTokenAllowsSuccessfulAuthentication() {
            // Arrange
            var server = CreateResourceServer();

            var client = server.CreateClient();

            var request = new HttpRequestMessage(HttpMethod.Get, "/");
            request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", "valid-token");

            // Act
            var response = await client.SendAsync(request);

            // Assert
            Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            Assert.Equal("Fabrikam", await response.Content.ReadAsStringAsync());
        }