<commit_before>﻿using UnityEngine;
using NUnit.Framework;

namespace Reduxity.Tests.Example {

	[TestFixture]
	public class CharacterMoverTests {

		private App app_;
		private GameObject mockGameObject_;
		private State initialStateDump_;
		private State currentStateDump_;

		[SetUpAttribute]
		public void Init() {
			// initialize app
			app_ = new App();
			app_.Initialize();

			// set initial state object dump
			initialStateDump_ = new State {}.Initialize();

			// create empty game object
			mockGameObject_ = new GameObject();
		}

		[TearDownAttribute]
		public void Dispose() {
			app_ = null;
			initialStateDump_ = null;
			currentStateDump_ = null;
			mockGameObject_ = null;
		}

		[Test]
		public void Should_return_accurate_move_distance_from_move_reducer() {
			CharacterMover.Action.Move mockMoveAction = new CharacterMover.Action.Move {
				inputVelocity = Vector2.up.normalized,
				playerTransform = mockGameObject_.transform,
				fixedDeltaTime = 1.0f
			};
			App.Store.Dispatch(mockMoveAction);

			State currentState = GetCurrentState();
			Debug.Log(currentState.Movement.distance);
			Assert.IsTrue(currentState.Movement.isMoving);
			Assert.AreEqual(currentState.Movement.distance, Vector3.forward);
		}

		[Test]
		public void Should_stop_on_stop_action() {
			CharacterMover.Action.Stop mockStopAction = new CharacterMover.Action.Stop {};
			App.Store.Dispatch(mockStopAction);

			State currentState = GetCurrentState();
			Assert.IsFalse(currentState.Movement.isMoving);
		}

		private State GetCurrentState() {
			return App.Store.GetState();
		}
	}
}<commit_msg>Fix tests<commit_after>﻿using UnityEngine;
using NUnit.Framework;

namespace Reduxity.Tests.Example {

	[TestFixture]
	public class CharacterMoverTests {

		private App app_;
		private GameObject mockGameObject_;

		[SetUpAttribute]
		public void Init() {
			// initialize app
			app_ = new App();
			app_.Initialize();

			// set initial state object dump
			new State {}.Initialize();

			// create empty game object
			mockGameObject_ = new GameObject();
		}

		[TearDownAttribute]
		public void Dispose() {
			app_ = null;
			mockGameObject_ = null;
		}

		[Test]
		public void Should_return_accurate_move_distance_from_move_reducer() {
			CharacterMover.Action.Move mockMoveAction = new CharacterMover.Action.Move {
				inputVelocity = Vector2.up.normalized,
				playerTransform = mockGameObject_.transform,
				fixedDeltaTime = 1.0f
			};
			App.Store.Dispatch(mockMoveAction);

			State currentState = GetCurrentState();
			Assert.IsTrue(currentState.Movement.isMoving);
			Assert.AreEqual(currentState.Movement.distance, Vector3.forward);
		}

		[Test]
		public void Should_stop_on_stop_action() {
			CharacterMover.Action.Stop mockStopAction = new CharacterMover.Action.Stop {};
			App.Store.Dispatch(mockStopAction);

			State currentState = GetCurrentState();
			Assert.IsFalse(currentState.Movement.isMoving);
		}

		private State GetCurrentState() {
			return App.Store.GetState();
		}
	}
}
{'fraction_non_alphanumeric': 0.09820239680426099, 'fraction_numerical': 0.002663115845539281, 'mean_word_length': 4.136752136752137, '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': '5702629', 'n_tokens_mistral': 1076, 'n_tokens_neox': 914, 'n_words': 189}