-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathGithubIssue1901.cs
41 lines (38 loc) · 1.33 KB
/
GithubIssue1901.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Linq.Expressions;
using System.Threading.Tasks;
using Elasticsearch.Net;
using Nest;
using Tests.Framework;
using Tests.Framework.Integration;
using Xunit;
using FluentAssertions;
namespace Tests.Reproduce
{
public class GithubIssue1901
{
private class Example
{
}
private const string ProxyAuthResponse = @"<html>
<head><title>401 Authorization Required</title></head>
<body bgcolor=""white"">
<center><h1>401 Authorization Required</h1></center>
<hr><center>nginx/1.4.6 (Ubuntu)</center>
</body>
</html>
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->";
[U]
public async Task BadAuthResponseDoesNotThrowExceptionWhenAttemptingToDeserializeResponse()
{
var client = TestClient.GetFixedReturnClient(ProxyAuthResponse, 401, contentType: "text/html", exception: new Exception("problem with the request as a result of 401"));
var source = await client.LowLevel.GetSourceAsync<Example>("examples", "example", "1");
source.Success.Should().BeFalse();
}
}
}