Skip to content

Commit ef46d05

Browse files
committed
add Reproduce1566Tests.cs
1 parent 0b60550 commit ef46d05

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Reflection;
5+
using Elasticsearch.Net;
6+
using FluentAssertions;
7+
using Nest.Tests.MockData.Domain;
8+
using NUnit.Framework;
9+
10+
namespace Nest.Tests.Unit.Reproduce
11+
{
12+
/// <summary>
13+
/// tests to reproduce reported errors
14+
/// </summary>
15+
[TestFixture]
16+
public class Reproduce1566Tests : BaseJsonTests
17+
{
18+
[Test]
19+
public void RawSurvives()
20+
{
21+
var searchRequest = new SearchRequest()
22+
{
23+
Aggregations = new Dictionary<string, IAggregationContainer>(),
24+
};
25+
26+
var filterContainer = new AggregationContainer()
27+
{
28+
Filter = new FilterAggregator
29+
{
30+
Filter = new FilterDescriptor<dynamic>().Raw(@"{""test"":""test""")
31+
},
32+
Aggregations = new Dictionary<string, IAggregationContainer>()
33+
};
34+
35+
searchRequest.Aggregations["base_filter"] = filterContainer;
36+
var serialized = _client.Serializer.Serialize(searchRequest).Utf8String();
37+
serialized.Should().Contain(@"""test""");
38+
39+
}
40+
}
41+
}

0 commit comments

Comments
 (0)