Skip to content

Commit 749d179

Browse files
committed
started on reproducing #654 and in the process found what made #658 / #659 fail
1 parent 9bc80a1 commit 749d179

File tree

2 files changed

+43
-2
lines changed

2 files changed

+43
-2
lines changed

src/Elasticsearch.Net/Connection/ConnectionConfiguration.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,11 @@ public class ConnectionConfiguration<T> : IConnectionConfigurationValues, IHideO
7575

7676
private bool _usePrettyResponses;
7777
bool IConnectionConfigurationValues.UsesPrettyResponses { get{ return _usePrettyResponses; } }
78-
79-
private bool _keepRawResponse;
78+
#if DEBUG
79+
private bool _keepRawResponse = true;
80+
#else
81+
private bool _keepRawResponse = false;
82+
#endif
8083
bool IConnectionConfigurationValues.KeepRawResponse { get{ return _keepRawResponse; } }
8184

8285
private int _maximumAsyncConnections;
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using Elasticsearch.Net;
5+
using Elasticsearch.Net.Connection;
6+
using Nest.Tests.MockData;
7+
using Nest.Tests.MockData.Domain;
8+
using NUnit.Framework;
9+
using System.Diagnostics;
10+
using FluentAssertions;
11+
12+
namespace Nest.Tests.Integration.Reproduce
13+
{
14+
[TestFixture]
15+
public class Reproduce654Tests : IntegrationTests
16+
{
17+
18+
/// <summary>
19+
/// https://github.com/Mpdreamz/NEST/issues/654
20+
/// </summary>
21+
[Test]
22+
public async void AsyncMethodsShouldNotThrowOnHttpError()
23+
{
24+
Assert.DoesNotThrow(async () =>
25+
{
26+
var searchResult = await this._client.DeleteAsync("index", "type", "id");
27+
});
28+
}
29+
[Test]
30+
public void SyncMethodsShouldNotThrowOnHttpError()
31+
{
32+
Assert.DoesNotThrow(() =>
33+
{
34+
var searchResult = this._client.Delete("index", "type", "id");
35+
});
36+
}
37+
}
38+
}

0 commit comments

Comments
 (0)