<commit_before>using System;
using System.Collections;
using Duality;
using NUnit.Framework;
using Pathfindax.Collections;

namespace Pathfindax.Test.Tests
{
	[TestFixture]
	class Array2DTests
	{
		[Test, TestCaseSource(typeof(Array2DTests), nameof(Array2DTestCases))]
		public void Array2D_2DimensionalAccess(Array2D<int> array2D, bool shouldCrash, Point2 pointToCheck)
		{
			if (shouldCrash)
			{
				Assert.Catch<IndexOutOfRangeException>(() =>
				{
					var unused = array2D[pointToCheck.X, pointToCheck.Y];
				});
			}
			else
			{
				var value = array2D[pointToCheck.X, pointToCheck.Y];
				Assert.AreEqual(value, array2D.Array[value]);
			}
		}

		public static IEnumerable Array2DTestCases
		{
			get
			{
				yield return GenerateArray2DTestCase(3, 5, false, new Point2(1, 3));
				yield return GenerateArray2DTestCase(3, 5, true, new Point2(1, 5));
				yield return GenerateArray2DTestCase(3, 5, true, new Point2(3, 2));
				yield return GenerateArray2DTestCase(9, 5, false, new Point2(3, 2));
			}
		}

		private static TestCaseData GenerateArray2DTestCase(int width, int height, bool shouldCrash, Point2 pointToCheck)
		{
			var array = new int[width * height];
			for (int i = 0; i < array.Length; i++)
			{
				array[i] = i;
			}
			return new TestCaseData(new Array2D<int>(array, width, height), shouldCrash, pointToCheck).SetName($"Size: {width}:{height}, ShouldCrash: {shouldCrash} Point: {pointToCheck}");
		}
	}
}<commit_msg>#40 array2d unit test split up<commit_after>using System;
using System.Collections;
using Duality;
using NUnit.Framework;
using Pathfindax.Collections;

namespace Pathfindax.Test.Tests
{
	[TestFixture]
	class Array2DTests
	{
		[Test, TestCaseSource(typeof(Array2DTests), nameof(Array2DTestCases))]
		public void Array2D_2DimensionalAccess_CorrectValue(Array2D<int> array2D, Point2 pointToCheck)
		{
			var value = array2D[pointToCheck.X, pointToCheck.Y];
			Assert.AreEqual(value, array2D.Array[value]);
		}

		[Test, TestCaseSource(typeof(Array2DTests), nameof(Array2DOutOfBoundsTestCases))]
		public void Array2D_2DimensionalAccess_OutOfBounds(Array2D<int> array2D, Point2 pointToCheck)
		{
			Assert.Catch<IndexOutOfRangeException>(() =>
			{
				var unused = array2D[pointToCheck.X, pointToCheck.Y];
			});
		}

		public static IEnumerable Array2DOutOfBoundsTestCases
		{
			get
			{
				yield return GenerateArray2DTestCase(3, 5, new Point2(1, 5));
				yield return GenerateArray2DTestCase(3, 5, new Point2(3, 2));
			}
		}

		public static IEnumerable Array2DTestCases
		{
			get
			{
				yield return GenerateArray2DTestCase(3, 5, new Point2(1, 3));
				yield return GenerateArray2DTestCase(9, 5, new Point2(3, 2));
			}
		}

		private static TestCaseData GenerateArray2DTestCase(int width, int height, Point2 pointToCheck)
		{
			var array = new int[width * height];
			for (int i = 0; i < array.Length; i++)
			{
				array[i] = i;
			}
			return new TestCaseData(new Array2D<int>(array, width, height), pointToCheck).SetName($"Size: {width}:{height}, Point: {pointToCheck}");
		}
	}
}
{'fraction_non_alphanumeric': 0.11640907596185465, 'fraction_numerical': 0.029924366984544558, 'mean_word_length': 4.540983606557377, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, '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': '7551318', 'n_tokens_mistral': 1236, 'n_tokens_neox': 1059, 'n_words': 235}