<commit_before>﻿using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentAssertions;
using Elasticsearch.Net;

namespace Nest.Watcher.Tests.Integration.Execute
{
	[TestFixture]
	public class Basic : IntegrationTest
	{
		[Test]
		public override void Fluent()
		{
			var watchId = PutWatch();
			var date = new DateTime(2015, 05, 05, 20, 58, 02);
			var executeWatch = this.Client.ExecuteWatch(watchId, w => w
				.TriggerData(te => te
					.Schedule(tes => tes
						.ScheduledTime(date)
						.TriggeredTime(date)
					)
				)
				.AlternativeInput(i => i.Add("foo", "bar"))
				.IgnoreCondition()
				//Not available in beta
				//.ActionModes(a => a
				//	.Add("_all", ActionExecutionMode.ForceSimulate)
				//)
				.RecordExecution(true)
			);

			Assert(executeWatch, watchId);
		}

		[Test]
		public override void ObjectInitializer()
		{
			var watchId = PutWatch();
			var date = new DateTime(2015, 05, 05, 20, 58, 02);
			var executeWatch = this.Client.ExecuteWatch(new ExecuteWatchRequest(watchId)
				{
					TriggerData = new TriggerEventContainer(new ScheduleTriggerEvent
					{
						ScheduledTime = date,
						TriggeredTime = date
					}),
					AlternativeInput = new Dictionary<string, object>
					{
						{ "foo", "bar" }
					},
					IgnoreCondition = true,
					RecordExecution = true
					//ActionModes = new Dictionary<string, ActionExecutionMode>
					//{
					//	{ "_all" , ActionExecutionMode.ForceSimulate}
					//}
				});
			Assert(executeWatch, watchId);
		}

		protected virtual void Assert(IExecuteWatchResponse response, string watchId)
		{
			response.IsValid.Should().BeTrue();<commit_msg>uncommented action modes now that  integration server runs GA<commit_after>﻿using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentAssertions;
using Elasticsearch.Net;

namespace Nest.Watcher.Tests.Integration.Execute
{
	[TestFixture]
	public class Basic : IntegrationTest
	{
		[Test]
		public override void Fluent()
		{
			var watchId = PutWatch();
			var date = new DateTime(2015, 05, 05, 20, 58, 02);
			var executeWatch = this.Client.ExecuteWatch(watchId, w => w
				.TriggerData(te => te
					.Schedule(tes => tes
						.ScheduledTime(date)
						.TriggeredTime(date)
					)
				)
				.AlternativeInput(i => i.Add("foo", "bar"))
				.IgnoreCondition()
				.ActionModes(a => a
					.Add("_all", ActionExecutionMode.ForceSimulate)
				)
				.RecordExecution(true)
			);

			Assert(executeWatch, watchId);
		}

		[Test]
		public override void ObjectInitializer()
		{
			var watchId = PutWatch();
			var date = new DateTime(2015, 05, 05, 20, 58, 02);
			var executeWatch = this.Client.ExecuteWatch(new ExecuteWatchRequest(watchId)
				{
					TriggerData = new TriggerEventContainer(new ScheduleTriggerEvent
					{
						ScheduledTime = date,
						TriggeredTime = date
					}),
					AlternativeInput = new Dictionary<string, object>
					{
						{ "foo", "bar" }
					},
					IgnoreCondition = true,
					RecordExecution = true,
					ActionModes = new Dictionary<string, ActionExecutionMode>
					{
						{ "_all" , ActionExecutionMode.ForceSimulate}
					}
				});
			Assert(executeWatch, watchId);
		}

		protected virtual void Assert(IExecuteWatchResponse response, string watchId)
		{
			response.IsValid.Should().BeTrue();
{'fraction_non_alphanumeric': 0.11623779946761313, 'fraction_numerical': 0.016563146997929608, 'mean_word_length': 3.2169576059850375, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6719378', 'n_tokens_mistral': 1388, 'n_tokens_neox': 1042, 'n_words': 241}