<commit_before>﻿using System;
using System.IO;
using System.Reflection;
using Elasticsearch.Net;
using FluentAssertions;
using Nest.Tests.MockData.Domain;
using NUnit.Framework;

namespace Nest.Tests.Unit.QueryParsers 
{
	[TestFixture]
	public class BaseParserTests : BaseJsonTests
	{
		public ISearchRequest GetSearchDescriptorForQuery(Func<SearchDescriptor<ElasticsearchProject>, SearchDescriptor<ElasticsearchProject>> create)
		{
			var descriptor = create(new SearchDescriptor<ElasticsearchProject>());
			var json = this._client.Serializer.Serialize(descriptor);
			Console.WriteLine(json.Utf8String());
			using (var ms = new MemoryStream(json))
			{
				ISearchRequest d = this._client.Serializer.Deserialize<SearchDescriptor<ElasticsearchProject>>(ms);
				d.Should().NotBeNull();
				d.Query.Should().NotBeNull();
				return d;
			}
		}
		public ISearchRequest GetSearchDescriptorForFilter(Func<SearchDescriptor<ElasticsearchProject>, SearchDescriptor<ElasticsearchProject>> create)<commit_msg>baseclass should be abstract<commit_after>﻿using System;
using System.IO;
using System.Reflection;
using Elasticsearch.Net;
using FluentAssertions;
using Nest.Tests.MockData.Domain;
using NUnit.Framework;

namespace Nest.Tests.Unit.QueryParsers 
{
	[TestFixture]
	public abstract class BaseParserTests : BaseJsonTests
	{
		public ISearchRequest GetSearchDescriptorForQuery(Func<SearchDescriptor<ElasticsearchProject>, SearchDescriptor<ElasticsearchProject>> create)
		{
			var descriptor = create(new SearchDescriptor<ElasticsearchProject>());
			var json = this._client.Serializer.Serialize(descriptor);
			Console.WriteLine(json.Utf8String());
			using (var ms = new MemoryStream(json))
			{
				ISearchRequest d = this._client.Serializer.Deserialize<SearchDescriptor<ElasticsearchProject>>(ms);
				d.Should().NotBeNull();
				d.Query.Should().NotBeNull();
				return d;
			}
		}
		public ISearchRequest GetSearchDescriptorForFilter(Func<SearchDescriptor<ElasticsearchProject>, SearchDescriptor<ElasticsearchProject>> create)
{'fraction_non_alphanumeric': 0.10039370078740158, 'fraction_numerical': 0.000984251968503937, 'mean_word_length': 6.614232209737827, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5625990', 'n_tokens_mistral': 614, 'n_tokens_neox': 568, 'n_words': 105}