<commit_before>﻿// Copyright (c) Aura development team - Licensed under GNU GPL
// For more information, see license file in the main folder

using System;
using System.Threading;
using Xunit;
using Yggrasil.Ai;
using Yggrasil.Ai.Composites;
using Yggrasil.Ai.Leafs;

namespace Yggdrasil.Test.AI.Leafs
{
	public class WaitTests
	{
		[Fact]
		public void Wait()
		{
			var state = new State();
			var waitTime = 2000;

			var routine = new Wait(TimeSpan.FromMilliseconds(waitTime));

			Assert.Equal(RoutineStatus.Running, routine.Act(state));
			Thread.Sleep(1000);
			Assert.Equal(RoutineStatus.Running, routine.Act(state));
			Thread.Sleep(1100);
			Assert.Equal(RoutineStatus.Success, routine.Act(state));
		}<commit_msg>Improved Wait routine unit tests<commit_after>﻿// Copyright (c) Aura development team - Licensed under GNU GPL
// For more information, see license file in the main folder

using System;
using System.Threading;
using Xunit;
using Yggrasil.Ai;
using Yggrasil.Ai.Composites;
using Yggrasil.Ai.Leafs;

namespace Yggdrasil.Test.AI.Leafs
{
	public class WaitTests
	{
		[Fact]
		public void Wait_2000()
		{
			var state = new State();
			var waitTime = 2000;

			var routine = new Wait(TimeSpan.FromMilliseconds(waitTime));

			Assert.Equal(RoutineStatus.Running, routine.Act(state));
			Thread.Sleep(1000);
			Assert.Equal(RoutineStatus.Running, routine.Act(state));
			Thread.Sleep(1100);
			Assert.Equal(RoutineStatus.Success, routine.Act(state));
		}

		[Fact]
		public void Wait_0()
		{
			var state = new State();
			var waitTime = 0;

			var routine = new Wait(TimeSpan.FromMilliseconds(waitTime));

			Assert.Equal(RoutineStatus.Success, routine.Act(state));
			Thread.Sleep(1000);
			Assert.Equal(RoutineStatus.Success, routine.Act(state));
		}
{'fraction_non_alphanumeric': 0.11688311688311688, 'fraction_numerical': 0.019198193111236588, 'mean_word_length': 4.353474320241692, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7463036', 'n_tokens_mistral': 685, 'n_tokens_neox': 587, 'n_words': 144}