<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Nest;
using Tests.Framework;
using Tests.Framework.MockData;
using static Tests.Framework.UrlTester;

namespace Tests.Search.Count
{
	public class CountUrlTests
	{
		[U] public async Task Urls()
		{
			var hardcoded = "hardcoded";
			await POST("/project/commits/_count")
				.Fluent(c=>c.Count<CommitActivity>())
				.Request(c=>c.Count<Project>(new CountRequest<CommitActivity>()))
				.FluentAsync(c=>c.CountAsync<CommitActivity>())
				.RequestAsync(c=>c.CountAsync<Project>(new CountRequest<CommitActivity>()))
				;

			await GET("/project/commits/_count?q=querystring")
				.Fluent(c=>c.Count<CommitActivity>(s=>s.Q("querystring")))
				.Request(c=>c.Count<Project>(new CountRequest<CommitActivity>() { Q = "querystring" }))
				.FluentAsync(c=>c.CountAsync<CommitActivity>(s=>s.Q("querystring")))
				.RequestAsync(c=>c.CountAsync<Project>(new CountRequest<CommitActivity>() { Q = "querystring" }))
				;
			await POST("/project/hardcoded/_count")
				.Fluent(c=>c.Count<CommitActivity>(s=>s.Type(hardcoded)))
				.Request(c=>c.Count<Project>(new CountRequest<CommitActivity>(typeof(Project), hardcoded)))
				.FluentAsync(c=>c.CountAsync<CommitActivity>(s=>s.Type(hardcoded)))
				.RequestAsync(c=>c.CountAsync<Project>(new CountRequest<CommitActivity>(typeof(Project), hardcoded)))
				;

			await POST("/project/_count")
				.Fluent(c=>c.Count<Project>(s=>s.Type(Types.All)))
				.Fluent(c=>c.Count<Project>(s=>s.AllTypes()))
				.Request(c=>c.Count<Project>(new CountRequest("project")))
				.Request(c=>c.Count<Project>(new CountRequest<Project>("project", Types.All)))
				.FluentAsync(c=>c.CountAsync<Project>(s=>s.Type(Types.All)))
				.RequestAsync(c=>c.CountAsync<Project>(new CountRequest<Project>(typeof(Project), Types.All)))
				.FluentAsync(c=>c.CountAsync<Project>(s=>s.AllTypes()))
				;

			await POST("/hardcoded/_count")
				.Fluent(c=>c.Count<Project>(s=>s.Index(hardcoded).Type(Types.All)))
				.Fluent(c=>c.Count<Project>(s=>s.Index(hardcoded).AllTypes()))
				.Request(c=>c.Count<Project>(new CountRequest(hardcoded)))
				.Request(c=>c.Count<Project>(new CountRequest<Project>(hardcoded, Types.All)))
				.FluentAsync(c=>c.CountAsync<Project>(s=>s.Index(hardcoded).Type(Types.All)))
				.RequestAsync(c=>c.CountAsync<Project>(new CountRequest<Project>(hardcoded, Types.All)))
				.FluentAsync(c=>c.CountAsync<Project>(s=>s.Index(hardcoded).AllTypes()))
				;

			await POST("/_count")
				.Fluent(c=>c.Count<Project>(s=>s.AllTypes().AllIndices()))
				.Request(c=>c.Count<Project>(new CountRequest()))
				.Request(c=>c.Count<Project>(new CountRequest<Project>(Nest.Indices.All, Types.All)))
				.FluentAsync(c=>c.CountAsync<Project>(s=>s.AllIndices().Type(Types.All)))
				.RequestAsync(c=>c.CountAsync<Project>(new CountRequest<Project>(Nest.Indices.All, Types.All)))
				.RequestAsync(c=>c.CountAsync<Project>(new CountRequest()))
				;
		}
	}
}
<commit_msg>updated tests to reflect updated q parameter<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Nest;
using Tests.Framework;
using Tests.Framework.MockData;
using static Tests.Framework.UrlTester;

namespace Tests.Search.Count
{
	public class CountUrlTests
	{
		[U] public async Task Urls()
		{
			var hardcoded = "hardcoded";
			await POST("/project/commits/_count")
				.Fluent(c=>c.Count<CommitActivity>())
				.Request(c=>c.Count<Project>(new CountRequest<CommitActivity>()))
				.FluentAsync(c=>c.CountAsync<CommitActivity>())
				.RequestAsync(c=>c.CountAsync<Project>(new CountRequest<CommitActivity>()))
				;

			await GET("/project/commits/_count?q=querystring")
				.Fluent(c=>c.Count<CommitActivity>(s=>s.QueryOnQueryString("querystring")))
				.Request(c=>c.Count<Project>(new CountRequest<CommitActivity>() { QueryOnQueryString = "querystring" }))
				.FluentAsync(c=>c.CountAsync<CommitActivity>(s=>s.QueryOnQueryString("querystring")))
				.RequestAsync(c=>c.CountAsync<Project>(new CountRequest<CommitActivity>() { QueryOnQueryString = "querystring" }))
				;
			await POST("/project/hardcoded/_count")
				.Fluent(c=>c.Count<CommitActivity>(s=>s.Type(hardcoded)))
				.Request(c=>c.Count<Project>(new CountRequest<CommitActivity>(typeof(Project), hardcoded)))
				.FluentAsync(c=>c.CountAsync<CommitActivity>(s=>s.Type(hardcoded)))
				.RequestAsync(c=>c.CountAsync<Project>(new CountRequest<CommitActivity>(typeof(Project), hardcoded)))
				;

			await POST("/project/_count")
				.Fluent(c=>c.Count<Project>(s=>s.Type(Types.All)))
				.Fluent(c=>c.Count<Project>(s=>s.AllTypes()))
				.Request(c=>c.Count<Project>(new CountRequest("project")))
				.Request(c=>c.Count<Project>(new CountRequest<Project>("project", Types.All)))
				.FluentAsync(c=>c.CountAsync<Project>(s=>s.Type(Types.All)))
				.RequestAsync(c=>c.CountAsync<Project>(new CountRequest<Project>(typeof(Project), Types.All)))
				.FluentAsync(c=>c.CountAsync<Project>(s=>s.AllTypes()))
				;

			await POST("/hardcoded/_count")
				.Fluent(c=>c.Count<Project>(s=>s.Index(hardcoded).Type(Types.All)))
				.Fluent(c=>c.Count<Project>(s=>s.Index(hardcoded).AllTypes()))
				.Request(c=>c.Count<Project>(new CountRequest(hardcoded)))
				.Request(c=>c.Count<Project>(new CountRequest<Project>(hardcoded, Types.All)))
				.FluentAsync(c=>c.CountAsync<Project>(s=>s.Index(hardcoded).Type(Types.All)))
				.RequestAsync(c=>c.CountAsync<Project>(new CountRequest<Project>(hardcoded, Types.All)))
				.FluentAsync(c=>c.CountAsync<Project>(s=>s.Index(hardcoded).AllTypes()))
				;

			await POST("/_count")
				.Fluent(c=>c.Count<Project>(s=>s.AllTypes().AllIndices()))
				.Request(c=>c.Count<Project>(new CountRequest()))
				.Request(c=>c.Count<Project>(new CountRequest<Project>(Nest.Indices.All, Types.All)))
				.FluentAsync(c=>c.CountAsync<Project>(s=>s.AllIndices().Type(Types.All)))
				.RequestAsync(c=>c.CountAsync<Project>(new CountRequest<Project>(Nest.Indices.All, Types.All)))
				.RequestAsync(c=>c.CountAsync<Project>(new CountRequest()))
				;
		}
	}
}

{'fraction_non_alphanumeric': 0.19373681648547786, 'fraction_numerical': 0.0, 'mean_word_length': 6.012514220705347, 'pattern_counts': {'":': 0, '<': 91, '<?xml version=': 0, '>': 183, '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': '4612577', 'n_tokens_mistral': 2367, 'n_tokens_neox': 2092, 'n_words': 214}