<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CodingInterviewSolutions.Named;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace CodingInterviewSolutionsUnitTests.Named
{
	[TestClass]
	class I18NUnitTests
	{
		[TestMethod]
		public void Test3Chars()
		{
			const string input = "abc";
			List<string> expectedOutput = new List<string>()
			{
				"abc",
				"ab1",
				"a1c",
				"a11",
				"1bc",
				"1b1",
				"11c",
				"111",
			};
			var sol1 = I18NCountingSolution.GenerateAllPossibleAbbreviationsInternal(input);
			var sol2 = I18NRecursiveSolution.GenerateAllPossibleAbbreviationsInternal(input);
			expectedOutput.ShouldBeEquivalentTo(sol1);
			expectedOutput.ShouldBeEquivalentTo(sol2);
		}
	}

}<commit_msg>Tests are almost ready<commit_after>﻿using System.Collections.Generic;

using CodingInterviewSolutions.Named;

using FluentAssertions;

using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace CodingInterviewSolutionsUnitTests.Named
{
	[TestClass]
	class SwapNodePairsInLinkedListUnitTests
	{
		[TestMethod]
		public void TestHelperMethods()
		{
			// Back and forth conversion
			var list = new List<int>() { 1, 2, 3, 4, 5, 6, 7 };
			var converted = ConvertLinkedListToList(ConvertListToLinkedList(list));

			converted.Should().BeEquivalentTo(list);
		}

		[TestMethod]
		public void Test1Node()
		{
			
		}

		private List<int> ConvertLinkedListToList(SwapNodePairsInLinkedList.LinkedListNode node)
		{
			List<int> list = new List<int>();

			while(node != null)
			{
				list.Add(node.Value);
				node = node.Next;
			}

			return list;
		}

		private SwapNodePairsInLinkedList.LinkedListNode ConvertListToLinkedList(List<int> list)
		{
			SwapNodePairsInLinkedList.LinkedListNode root = null;
			SwapNodePairsInLinkedList.LinkedListNode current = null;
			foreach (var value in list)
			{
				var newNode = new SwapNodePairsInLinkedList.LinkedListNode(value);

				if (root == null)
				{
					root = newNode;
					current = root;
					continue;
				}

				current.Next = new SwapNodePairsInLinkedList.LinkedListNode(value);
				current = current.Next;
			}

			return root;
		}
	}

}
{'fraction_non_alphanumeric': 0.10075791350869372, 'fraction_numerical': 0.013820775746767721, 'mean_word_length': 4.158620689655172, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '5017661', 'n_tokens_mistral': 902, 'n_tokens_neox': 737, 'n_words': 141}