using System.Security.Cryptography;
using System.Text;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Collections.Generic;
using System.Linq;

#<INSERT>

class NumberSorterTest {
    public static int Main(string[] args) {
        bool allTestsPassed = true;

        // Test case 1
        string test1Input = "three one five";
        string test1Expected = "one three five";
        string test1Result = NumberSorter.SortWordNumbers(test1Input);
        if (test1Result != test1Expected) {
            Console.WriteLine($"Test 1 Failed: Expected '{test1Expected}', but got '{test1Result}'");
            allTestsPassed = false;
        }

        // Test case 2
        string test2Input = "nine eight seven";
        string test2Expected = "seven eight nine";
        string test2Result = NumberSorter.SortWordNumbers(test2Input);
        if (test2Result != test2Expected) {
            Console.WriteLine($"Test 2 Failed: Expected '{test2Expected}', but got '{test2Result}'");
            allTestsPassed = false;
        }

        // Test case 3
        string test3Input = "zero four two";
        string test3Expected = "zero two four";
        string test3Result = NumberSorter.SortWordNumbers(test3Input);
        if (test3Result != test3Expected) {
            Console.WriteLine($"Test 3 Failed: Expected '{test3Expected}', but got '{test3Result}'");
            allTestsPassed = false;
        }

        // Test case 4
        string test4Input = "six three one";
        string test4Expected = "one three six";
        string test4Result = NumberSorter.SortWordNumbers(test4Input);
        if (test4Result != test4Expected) {
            Console.WriteLine($"Test 4 Failed: Expected '{test4Expected}', but got '{test4Result}'");
            allTestsPassed = false;
        }

        // Test case 5
        string test5Input = "five four three two one";
        string test5Expected = "one two three four five";
        string test5Result = NumberSorter.SortWordNumbers(test5Input);
        if (test5Result != test5Expected) {
            Console.WriteLine($"Test 5 Failed: Expected '{test5Expected}', but got '{test5Result}'");
            allTestsPassed = false;
        }

        if (allTestsPassed) {
            Console.WriteLine("All tests passed successfully.");
            return 0;
        } else {
            return -1;
        }
    }
}

using System.Security.Cryptography;
using System.Text;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Collections.Generic;
using System.Linq;
class NumberSorter {
    public static string SortWordNumbers(string inputWords) {
        Dictionary<string, int> numberMap = new Dictionary<string, int> {
            {"zero", 0}, {"one", 1}, {"two", 2}, {"three", 3}, {"four", 4},
            {"five", 5}, {"six", 6}, {"seven", 7}, {"eight", 8}, {"nine", 9}
        };
        string sortedWords = String.Join(" ", inputWords.Split(' ')
            .OrderBy(word => numberMap[word])
            .ToArray());
        return sortedWords;
    }
    public static void Check() {
        Debug.Assert(SortWordNumbers("three one five") == "one three five");
        Debug.Assert(SortWordNumbers("nine eight seven") == "seven eight nine");
        Debug.Assert(SortWordNumbers("zero four two") == "zero two four");
        Console.WriteLine("All tests passed successfully.");
    }
}
class Program {

}

Imagine you're working on a program that needs to process a list of English words representing numbers and sort them according to their numerical value. You receive a single string containing these words, each separated by a space. The words will represent numbers from 'zero' to 'nine'. Your task is to write a function that sorts these words in ascending order based on their numerical value and returns a new string with the sorted words, still separated by spaces. For example, if you're given the string "three one five", your function should return "one three five". Can you write a function to accomplish this?

Please use C# to implement the complete code without the Main function. Please follow the following type definitions:

```csharp
using xxx
...
class NumberSorter
{
    public static string SortWordNumbers(string inputWords) {
    {
        // Implement your code here.
    }
}
```


using System.Security.Cryptography;
using System.Text;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Collections.Generic;
using System.Linq;

#<INSERT>

class PhoneticConverterTest
{
    public static int Main(string[] args)
    {
        var testCases = new Dictionary<List<int>, List<string>>()
        {
            { new List<int>{ 12, 45, 67, 89, 23 }, new List<string>{ "One Two", "Two Three", "Four Five", "Six Seven", "Eight Nine" } },
            { new List<int>(), new List<string>() },
            { new List<int>{ 5, 103, 70 }, new List<string>{ "Seven Zero" } },
            { new List<int>{ 10, 99, 11, 12, 13 }, new List<string>{ "One Zero", "One One", "One Two", "One Three", "Nine Nine" } },
            { new List<int>{ 99, 10, 55, 77, 33 }, new List<string>{ "One Zero", "Three Three", "Five Five", "Seven Seven", "Nine Nine" } }
        };

        int result = 0;
        foreach (var testCase in testCases)
        {
            var output = PhoneticConverter.ConvertToPhonetic(testCase.Key);
            if (output.SequenceEqual(testCase.Value))
            {
                Console.WriteLine("Test passed.");
            }
            else
            {
                Console.WriteLine("Test failed.");
                result = -1;
            }
        }

        return result;
    }
}

using System.Security.Cryptography;
using System.Text;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Collections.Generic;
using System.Linq;
class PhoneticConverter
{
    public static List<string> ConvertToPhonetic(List<int> numbers)
    {
        string[] digitWords = { "Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine" };
        List<string> result = new List<string>();
        foreach (int number in numbers.Where(num => num >= 10 && num <= 99).OrderBy(num => num))
        {
            string phonetic = "";
            phonetic += digitWords[number / 10] + " " + digitWords[number % 10];
            result.Add(phonetic);
        }
        return result;
    }
    public static void Check()
    {
        var testCases = new Dictionary<List<int>, List<string>>()
        {
            { new List<int>{ 12, 45, 67, 89, 23 }, new List<string>{ "One Two", "Two Three", "Four Five", "Six Seven", "Eight Nine" } },
            { new List<int>(), new List<string>() },
            { new List<int>{ 5, 103, 70 }, new List<string>{ "Seven Zero" } }
        };
        foreach (var testCase in testCases)
        {
            var output = ConvertToPhonetic(testCase.Key);
            if (output.SequenceEqual(testCase.Value))
            {
                Console.WriteLine("Test passed.");
            }
            else
            {
                Console.WriteLine("Test failed.");
            }
        }
    }
}
class Program
{

}

Can you write a method that takes a list of integers as input, filters out numbers that are not within the range of 10 to 99 (inclusive), sorts these numbers in ascending order, and then converts each number into its phonetic equivalent? For instance, 10 should be converted to "One Zero", 34 to "Three Four", and so on, up to 99. The method should then return the list of these phonetic strings. If the input list is empty, your method should return an empty list. Ignore any numbers outside the specified range.

For example:
- If the input is `[12, 45, 67, 89, 23]`, the output should be `["One Two", "Two Three", "Four Five", "Six Seven", "Eight Nine"]`.
- For an input of `[]`, just return an empty list `[]`.
- If the input contains numbers not within the range of 10 to 99 like `[5, 103, 70]`, the method should only process and return `["Seven Zero"]`.

Please use C# to implement the complete code without the Main function. Please follow the following type definitions:

```csharp
using xxx
...
class PhoneticConverter
{
    public static List<string> ConvertToPhonetic(List<int> numbers)
    {
        // Implement your code here.
    }
}
```


using System.Security.Cryptography;
using System.Text;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Collections.Generic;
using System.Linq;

#<INSERT>

class WordFrequencyAnalyzerTest
{
    public static int Main(string[] args)
    {
        var testCases = new List<Tuple<string, Dictionary<string, int>>>
        {
            new Tuple<string, Dictionary<string, int>>("Apple banana apple", new Dictionary<string, int> { { "apple", 2 } }),
            new Tuple<string, Dictionary<string, int>>("Dog cat mouse cat dog", new Dictionary<string, int> { { "dog", 2 }, { "cat", 2 } }),
            new Tuple<string, Dictionary<string, int>>("One two three two three three", new Dictionary<string, int> { { "three", 3 } }),
            new Tuple<string, Dictionary<string, int>>("Hello world hello", new Dictionary<string, int> { { "hello", 2 } }),
            new Tuple<string, Dictionary<string, int>>("A B C A B C", new Dictionary<string, int> { { "a", 2 }, { "b", 2 }, { "c", 2 } })
        };

        int testPassed = 0;

        foreach (var testCase in testCases)
        {
            var result = WordFrequencyAnalyzer.GetMostFrequentWords(testCase.Item1);
            if (result.SequenceEqual(testCase.Item2))
            {
                testPassed++;
            }
            else
            {
                Console.WriteLine($"Test failed for input: {testCase.Item1}");
                Console.WriteLine($"Expected: {string.Join(", ", testCase.Item2.Select(kv => $"{kv.Key}: {kv.Value}"))}");
                Console.WriteLine($"Actual: {string.Join(", ", result.Select(kv => $"{kv.Key}: {kv.Value}"))}");
            }
        }

        if (testPassed == testCases.Count)
        {
            Console.WriteLine("All tests passed.");
            return 0;
        }
        else
        {
            Console.WriteLine($"{testPassed} out of {testCases.Count} tests passed.");
            return -1;
        }
    }
}

using System.Security.Cryptography;
using System.Text;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Collections.Generic;
using System.Linq;
class WordFrequencyAnalyzer
{
    public static Dictionary<string, int> GetMostFrequentWords(string sentence)
    {
        var words = sentence.ToLower().Split(' ');
        var wordCounts = new Dictionary<string, int>();
        foreach (var word in words)
        {
            if (!string.IsNullOrWhiteSpace(word))
            {
                if (wordCounts.ContainsKey(word))
                {
                    wordCounts[word]++;
                }
                else
                {
                    wordCounts[word] = 1;
                }
            }
        }
        int maxCount = wordCounts.Values.Count > 0 ? wordCounts.Values.Max() : 0;
        return wordCounts.Where(pair => pair.Value == maxCount).ToDictionary(pair => pair.Key, pair => pair.Value);
    }
    : {kv.Value}")));
        Console.WriteLine("Test 2: " + string.Join(", ", GetMostFrequentWords(test2).Select(kv => $"{kv.Key}: {kv.Value}")));
        Console.WriteLine("Test 3: " + string.Join(", ", GetMostFrequentWords(test3).Select(kv => $"{kv.Key}: {kv.Value}")));
    }
}

You have been tasked with writing a C# program that analyzes a sentence and identifies the most frequently occurring word(s) in it. The sentence will be provided as a string containing words separated by spaces. Your program should return a dictionary where the keys are the most frequently occurring word(s), and the values are the counts of those words. If there are multiple words with the same highest frequency, include all of them in the dictionary. The words in the input string are case-insensitive, and the output should have the words in lowercase.

For example, if the input is "Apple banana apple", the output should be a dictionary containing {"apple", 2} because 'apple' (case-insensitive) appears twice, which is more than any other word. If the input is "Dog cat mouse cat dog", the output should be {"dog", 2}, {"cat", 2} since both 'dog' and 'cat' appear twice, which is the highest frequency in this sentence.

Please use C# to implement the complete code without the Main function. Please follow the following type definitions:

```csharp
using xxx
...
class WordFrequencyAnalyzer
{
    public static Dictionary<string, int> GetMostFrequentWords(string sentence)
    {
        // Implement your code here.
    }
}
```


using System.Security.Cryptography;
using System.Text;
using System.Linq;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Collections.Generic;

#<INSERT>

class MusicTranslatorTest {
    public static int Main(string[] args) {
        bool allTestsPassed = true;

        // Test case 1
        string input1 = "W H- Q- H-";
        List<int> expected1 = new List<int> { 4, 2, 1, 2 };
        List<int> result1 = MusicTranslator.TranslateNotesToBeats(input1);
        allTestsPassed &= result1.SequenceEqual(expected1);

        // Test case 2
        string input2 = "Q- Q- Q- Q-";
        List<int> expected2 = new List<int> { 1, 1, 1, 1 };
        List<int> result2 = MusicTranslator.TranslateNotesToBeats(input2);
        allTestsPassed &= result2.SequenceEqual(expected2);

        // Test case 3
        string input3 = "W W W";
        List<int> expected3 = new List<int> { 4, 4, 4 };
        List<int> result3 = MusicTranslator.TranslateNotesToBeats(input3);
        allTestsPassed &= result3.SequenceEqual(expected3);

        // Test case 4
        string input4 = "H- Q- W";
        List<int> expected4 = new List<int> { 2, 1, 4 };
        List<int> result4 = MusicTranslator.TranslateNotesToBeats(input4);
        allTestsPassed &= result4.SequenceEqual(expected4);

        // Test case 5
        string input5 = "W H- Q- H- H- Q- Q- Q- Q- W W";
        List<int> expected5 = new List<int> { 4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4 };
        List<int> result5 = MusicTranslator.TranslateNotesToBeats(input5);
        allTestsPassed &= result5.SequenceEqual(expected5);

        if (allTestsPassed) {
            Console.WriteLine("All tests passed.");
            return 0;
        } else {
            Console.WriteLine("Some tests failed.");
            return -1;
        }
    }
}

using System.Security.Cryptography;
using System.Text;
using System.Linq;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Collections.Generic;
class MusicTranslator {
    public static List<int> TranslateNotesToBeats(string notes) {
        List<int> durations = new List<int>();
        string[] noteSymbols = notes.Split(' ');
        foreach (string symbol in noteSymbols) {
            switch (symbol) {
                case "W":
                    durations.Add(4);
                    break;
                case "H-":
                    durations.Add(2);
                    break;
                case "Q-":
                    durations.Add(1);
                    break;
                default:
                    throw new ArgumentException("Invalid note symbol encountered.");
            }
        }
        return durations;
    }
    public static void Check() {
        string input = "W H- Q- H- H- Q- Q- Q- Q- W W";
        List<int> expected = new List<int> { 4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4 };
        List<int> result = TranslateNotesToBeats(input);
        Console.WriteLine($"Input: {input}");
        Console.WriteLine($"Expected: [{string.Join(", ", expected)}]");
        Console.WriteLine($"Result: [{string.Join(", ", result)}]");
        if (expected.SequenceEqual(result)) {
            Console.WriteLine("The method is correct.");
        } else {
            Console.WriteLine("The method is incorrect.");
        }
    }

}

Imagine you are developing a feature for a music education app that helps users understand the duration of different musical notes in a simple and visual way. You've decided to represent musical notes with certain symbols in a string format, and now you need to write a method that translates this string into a list of durations, where each duration corresponds to the number of beats a note lasts. The symbols for the notes are as follows:

- 'W' represents a whole note, which lasts for 4 beats.
- 'H' followed by a '-' represents a half note, which lasts for 2 beats.
- 'Q' followed by a '-' represents a quarter note, which lasts for 1 beat.

Write a method `TranslateNotesToBeats` that takes a string of notes represented by the symbols above and returns a list of integers, where each integer represents the duration of the corresponding note in the input string.

For example, given the input string `"W H- Q- H- H- Q- Q- Q- Q- W W"`, your method should return a list of integers `[4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]`.

Please use C# to implement the complete code without the Main function. Please follow the following type definitions:

```csharp
using xxx
...
class MusicTranslator
{
    public static List<int> TranslateNotesToBeats(string notes) {
    {
        // Implement your code here.
    }
}
```


using System.Security.Cryptography;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using System.Numerics;
using System;

#<INSERT>

class MathOperationsTest {
    public static int Main(string[] args) {
        bool allTestsPassed = true;

        // Test case 1
        MathOperations.VerifyResult(2, 3, 6);
        if (MathOperations.MultiplyNumbers(2, 3) != 6) allTestsPassed = false;

        // Test case 2
        MathOperations.VerifyResult(5, 4, 20);
        if (MathOperations.MultiplyNumbers(5, 4) != 20) allTestsPassed = false;

        // Test case 3
        MathOperations.VerifyResult(10, 5, 50);
        if (MathOperations.MultiplyNumbers(10, 5) != 50) allTestsPassed = false;

        // Test case 4
        MathOperations.VerifyResult(7, 0, 0);
        if (MathOperations.MultiplyNumbers(7, 0) != 0) allTestsPassed = false;

        // Test case 5
        MathOperations.VerifyResult(1, 1, 1);
        if (MathOperations.MultiplyNumbers(1, 1) != 1) allTestsPassed = false;

        if (allTestsPassed) {
            Console.WriteLine("All tests passed.");
            return 0;
        } else {
            Console.WriteLine("Some tests failed.");
            return -1;
        }
    }
}

using System.Security.Cryptography;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using System.Numerics;
using System;
class MathOperations {
    public static int MultiplyNumbers(int x, int y) {
        return x * y;
    }
    public static void VerifyResult(int x, int y, int expected) {
        int result = MultiplyNumbers(x, y);
        if (result == expected) {
            Console.WriteLine("Test Passed");
        } else {
            Console.WriteLine($"Test Failed: Expected {expected}, but got {result}");
        }
    }

}

Can you write a C# program that multiplies two numbers together and returns the result? The program should include a method named `MultiplyNumbers` that takes two integer parameters, multiplies them, and then returns the product. To ensure the method works as expected, please include a static method named `VerifyResult` that takes two integers (the inputs to the multiplication) and the expected product. This method should call `MultiplyNumbers` with the provided inputs and check if the returned result matches the expected product, printing "Test Passed" or "Test Failed" accordingly.

Here's an example of how your code should work:
- If you call `VerifyResult(2, 3, 6)`, it should print "Test Passed" because 2 * 3 = 6.
- If you call `VerifyResult(5, 4, 20)`, it should also print "Test Passed".

Ensure your code is self-contained and imports any necessary packages at the beginning.

Please use C# to implement the complete code without the Main function. Please follow the following type definitions:

```csharp
using xxx
...
class MathOperations
{
    public static int MultiplyNumbers(int x, int y) {
    {
        // Implement your code here.
    }
}
```


using System.Security.Cryptography;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using System.Numerics;
using System;

#<INSERT>

class HexConverterTest {
    public static int Main(string[] args) {
        bool allTestsPassed = true;

        // Test case 1
        if (HexConverter.IntToHexWithPrefixSuffix(255) != "hxffhx") {
            Console.WriteLine("Test case 1 failed.");
            allTestsPassed = false;
        }

        // Test case 2
        if (HexConverter.IntToHexWithPrefixSuffix(16) != "hx10hx") {
            Console.WriteLine("Test case 2 failed.");
            allTestsPassed = false;
        }

        // Test case 3
        if (HexConverter.IntToHexWithPrefixSuffix(4095) != "hxfffhx") {
            Console.WriteLine("Test case 3 failed.");
            allTestsPassed = false;
        }

        // Test case 4
        if (HexConverter.IntToHexWithPrefixSuffix(0) != "hx0hx") {
            Console.WriteLine("Test case 4 failed.");
            allTestsPassed = false;
        }

        // Test case 5
        if (HexConverter.IntToHexWithPrefixSuffix(1) != "hx1hx") {
            Console.WriteLine("Test case 5 failed.");
            allTestsPassed = false;
        }

        if (allTestsPassed) {
            Console.WriteLine("All tests passed successfully.");
            return 0;
        } else {
            return -1;
        }
    }
}

using System.Security.Cryptography;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using System.Numerics;
using System;
class HexConverter {
    public static string IntToHexWithPrefixSuffix(int number) {
        string hexValue = number.ToString("X");
        return $"hx{hexValue.ToLower()}hx";
    }
    public static void CheckFunction() {
        Debug.Assert(IntToHexWithPrefixSuffix(255) == "hxffhx");
        Debug.Assert(IntToHexWithPrefixSuffix(16) == "hx10hx");
        Debug.Assert(IntToHexWithPrefixSuffix(4095) == "hxfffhx");
        Console.WriteLine("All tests passed successfully.");
    }

}

Can you write a C# program that takes an integer as input and converts it into its hexadecimal representation, but with a twist? The output string should have "hx" prefixed and suffixed to the actual hexadecimal string. For instance, if the input is 255, the output should be "hxffhx", and for 16, it should be "hx10hx". Make sure to include all necessary imports at the beginning of your code snippet, and the code should be easy to understand and self-contained. Additionally, include a function to validate your solution with given test cases.

Please use C# to implement the complete code without the Main function. Please follow the following type definitions:

```csharp
using xxx
...
class HexConverter
{
    public static string IntToHexWithPrefixSuffix(int number) {
    {
        // Implement your code here.
    }
}
```


using System.Security.Cryptography;
using System.Text;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Collections.Generic;
using System.Linq;

#<INSERT>

class EmployeeManagementTest
{
    public static int Main()
    {
        bool allTestsPassed = true;

        // Test case 1
        var result1 = EmployeeManagement.FindSecondHighestSalary(new List<int> { 60000, 50000, 80000, 90000 });
        if (result1 != 80000)
        {
            Console.WriteLine("Test case 1 failed.");
            allTestsPassed = false;
        }

        // Test case 2
        var result2 = EmployeeManagement.FindSecondHighestSalary(new List<int> { 45000 });
        if (result2 != null)
        {
            Console.WriteLine("Test case 2 failed.");
            allTestsPassed = false;
        }

        // Test case 3
        var result3 = EmployeeManagement.FindSecondHighestSalary(new List<int>());
        if (result3 != null)
        {
            Console.WriteLine("Test case 3 failed.");
            allTestsPassed = false;
        }

        // Test case 4
        var result4 = EmployeeManagement.FindSecondHighestSalary(new List<int> { 90000, 90000 });
        if (result4 != null)
        {
            Console.WriteLine("Test case 4 failed.");
            allTestsPassed = false;
        }

        // Test case 5
        var result5 = EmployeeManagement.FindSecondHighestSalary(new List<int> { 10000, 10000, 20000, 20000, 30000 });
        if (result5 != 20000)
        {
            Console.WriteLine("Test case 5 failed.");
            allTestsPassed = false;
        }

        if (allTestsPassed)
        {
            Console.WriteLine("All test cases passed.");
            return 0;
        }
        else
        {
            return -1;
        }
    }
}

using System.Security.Cryptography;
using System.Text;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Collections.Generic;
using System.Linq;
class EmployeeManagement
{
    public static Nullable<int> FindSecondHighestSalary(List<int> salaries)
    {
        if (salaries == null || salaries.Count < 2)
        {
            return null;
        }
        var uniqueSalaries = salaries.Distinct().OrderByDescending(salary => salary).ToList();
        if(uniqueSalaries.Count < 2)
        {
            return null;
        }
        return uniqueSalaries[1];
    }
    public ));
        Console.WriteLine(FindSecondHighestSalary(new List<int>{45000}));
        Console.WriteLine(FindSecondHighestSalary(new List<int>()));
        Console.WriteLine(FindSecondHighestSalary(new List<int>{90000, 90000}));
    }
}

You're working on a project that involves managing a collection of employee records. You need a function that helps you find the salary of the employee who has the second highest salary in your dataset. Your dataset is a list of employee salaries (all unique values). Write a function named `FindSecondHighestSalary` that returns the second highest salary from the list. If your list doesn't have at least two unique salaries, the function should return `null`.

Here's how the function should work:

- If the list contains `[60000, 50000, 80000, 90000]`, your function should return `80000`.
- For a list like `[45000]`, since there's no second highest salary, your function should return `null`.
- Similarly, if the list is empty, return `null`.

Please use C# to implement the complete code without the Main function. Please follow the following type definitions:

```csharp
using xxx
...
class EmployeeManagement
{
    public ));
    {
        // Implement your code here.
    }
}
```


using System.Security.Cryptography;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Text;

#<INSERT>

class EvenNumberGeneratorTest {
    public static int Main(string[] args) {
        bool allTestsPassed = true;

        // Test Case 1
        if (EvenNumberGenerator.EvenNumbersList(10) != "2,4,6,8,10") {
            Console.WriteLine("Test 1 Failed");
            allTestsPassed = false;
        } else {
            Console.WriteLine("Test 1 Passed");
        }

        // Test Case 2
        if (EvenNumberGenerator.EvenNumbersList(15) != "2,4,6,8,10,12,14") {
            Console.WriteLine("Test 2 Failed");
            allTestsPassed = false;
        } else {
            Console.WriteLine("Test 2 Passed");
        }

        // Test Case 3
        if (EvenNumberGenerator.EvenNumbersList(1) != "") {
            Console.WriteLine("Test 3 Failed");
            allTestsPassed = false;
        } else {
            Console.WriteLine("Test 3 Passed");
        }

        // Test Case 4
        if (EvenNumberGenerator.EvenNumbersList(2) != "2") {
            Console.WriteLine("Test 4 Failed");
            allTestsPassed = false;
        } else {
            Console.WriteLine("Test 4 Passed");
        }

        return allTestsPassed ? 0 : -1;
    }
}

using System.Security.Cryptography;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Text;
class EvenNumberGenerator {
    public static string EvenNumbersList(int n) {
        if (n < 2) return "";
        StringBuilder result = new StringBuilder();
        for (int i = 2; i <= n; i += 2) {
            result.Append(i);
            if (i < n - 1) {
                result.Append(",");
            }
        }
        return result.ToString();
    }
    public static void TestEvenNumbersList() {
        Console.WriteLine(EvenNumbersList(10) == "2,4,6,8,10" ? "Test 1 Passed" : "Test 1 Failed");
        Console.WriteLine(EvenNumbersList(15) == "2,4,6,8,10,12,14" ? "Test 2 Passed" : "Test 2 Failed");
        Console.WriteLine(EvenNumbersList(1) == "" ? "Test 3 Passed" : "Test 3 Failed");
        Console.WriteLine(EvenNumbersList(2) == "2" ? "Test 4 Passed" : "Test 4 Failed");
    }

}

Can you write a program in C# that generates a comma-separated list of even numbers starting from 2 up to a specified number, inclusive? The program should be able to handle cases where the specified number is both even and odd. If the specified number is less than 2, the program should return an empty string. Make sure to include necessary imports at the beginning of your code snippet. To verify the correctness of your solution, also include a function that tests your program with various inputs.

Please use C# to implement the complete code without the Main function. Please follow the following type definitions:

```csharp
using xxx
...
class EvenNumberGenerator
{
    public static string EvenNumbersList(int n) {
    {
        // Implement your code here.
    }
}
```


using System.Security.Cryptography;
using System.Text;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Collections.Generic;
using System.Linq;

#<INSERT>

class OddNumberFilterTest {
    public static int Main(string[] args) {
        int result = 0;

        // Test Case 1
        var testList1 = new List<int>{4, 7, 9, 12, 15, 18};
        var expectedOutput1 = new List<int>{7, 9, 15};
        var actualOutput1 = OddNumberFilter.GetOddNumbers(testList1);
        if (!expectedOutput1.SequenceEqual(actualOutput1)) {
            Console.WriteLine("Test Case 1 Failed");
            result = -1;
        }

        // Test Case 2
        var testList2 = new List<int>{1, 3, 5, 7, 9};
        var expectedOutput2 = new List<int>{1, 3, 5, 7, 9};
        var actualOutput2 = OddNumberFilter.GetOddNumbers(testList2);
        if (!expectedOutput2.SequenceEqual(actualOutput2)) {
            Console.WriteLine("Test Case 2 Failed");
            result = -1;
        }

        // Test Case 3
        var testList3 = new List<int>{2, 4, 6, 8, 10};
        var expectedOutput3 = new List<int>{};
        var actualOutput3 = OddNumberFilter.GetOddNumbers(testList3);
        if (!expectedOutput3.SequenceEqual(actualOutput3)) {
            Console.WriteLine("Test Case 3 Failed");
            result = -1;
        }

        // Test Case 4
        var testList4 = new List<int>{-3, -2, -1, 0, 1, 2, 3};
        var expectedOutput4 = new List<int>{-3, -1, 1, 3};
        var actualOutput4 = OddNumberFilter.GetOddNumbers(testList4);
        if (!expectedOutput4.SequenceEqual(actualOutput4)) {
            Console.WriteLine("Test Case 4 Failed");
            result = -1;
        }

        return result;
    }
}

using System.Security.Cryptography;
using System.Text;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Collections.Generic;
using System.Linq;
class OddNumberFilter {
    public static List<int> GetOddNumbers(List<int> numbers) {
        return numbers.Where(number => number % 2 != 0).ToList();
    }
    public static void Check() {
        var testList = new List<int>{4, 7, 9, 12, 15, 18};
        var expectedOutput = new List<int>{7, 9, 15};
        var actualOutput = GetOddNumbers(testList);
        Console.WriteLine($"Expected: [{String.Join(", ", expectedOutput)}]");
        Console.WriteLine($"Actual: [{String.Join(", ", actualOutput)}]");
        Debug.Assert(expectedOutput.SequenceEqual(actualOutput), "The GetOddNumbers method did not return the expected output.");
    }

}

Can you write a C# method that filters out all the even numbers from a given list of integers and returns only the odd numbers? The method should accept a list of integers as its parameter and return a new list containing only the odd integers from the original list.

For example, if the input list is `[4, 7, 9, 12, 15, 18]`, the method should return `[7, 9, 15]` as these are the odd numbers from the given list.

Please use C# to implement the complete code without the Main function. Please follow the following type definitions:

```csharp
using xxx
...
class OddNumberFilter
{
    public static List<int> GetOddNumbers(List<int> numbers) {
    {
        // Implement your code here.
    }
}
```


using System.Security.Cryptography;
using System.Text;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Collections.Generic;
using System.Linq;

#<INSERT>

class DataAnalysisTest
{
    public static bool TestCalculateStandardDeviation(List<int> input, double expected)
    {
        try
        {
            double result = DataAnalysis.CalculateStandardDeviation(input);
            return Math.Abs(result - expected) < 1e-6;
        }
        catch (Exception ex)
        {
            Console.WriteLine($"Test failed with exception: {ex.Message}");
            return false;
        }
    }

    public static int Main(string[] args)
    {
        bool allTestsPassed = true;

        // Test Case 1: Simple list of integers
        allTestsPassed &= TestCalculateStandardDeviation(new List<int> { 1, 2, 3, 4, 5 }, 1.4142135623730951);

        // Test Case 2: List with all identical elements
        allTestsPassed &= TestCalculateStandardDeviation(new List<int> { 5, 5, 5, 5, 5 }, 0.0);

        // Test Case 3: List with a larger range of values
        allTestsPassed &= TestCalculateStandardDeviation(new List<int> { 10, 20, 30, 40, 50 }, 14.142135623730951);

        // Test Case 4: List with negative values
        allTestsPassed &= TestCalculateStandardDeviation(new List<int> { -1, -2, -3, -4, -5 }, 1.4142135623730951);

        return allTestsPassed ? 0 : -1;
    }
}

using System.Security.Cryptography;
using System.Text;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Collections.Generic;
using System.Linq;
class DataAnalysis
{
    public static double CalculateStandardDeviation(List<int> numbers)
    {
        if (numbers == null || numbers.Count == 0)
        {
            throw new ArgumentException("The numbers list cannot be null or empty.", nameof(numbers));
        }
        double mean = numbers.Average();
        double sumOfSquaredDifferences = numbers.Select(num => (num - mean) * (num - mean)).Sum();
        double standardDeviation = Math.Sqrt(sumOfSquaredDifferences / numbers.Count);
        return standardDeviation;
    }
    public ;
        double stdDeviation = CalculateStandardDeviation(sampleData);
        Console.WriteLine($"The Standard Deviation is: {stdDeviation}");
    }
}

Hey, can you help me figure out how to calculate the Standard Deviation for a series of numbers? I have a list of integers, and I need to find the Standard Deviation to understand how spread out the numbers are from their average. It's for a project I'm working on where accurately measuring this spread is crucial for the data analysis part. Could you show me how to write a program in C# that does this calculation?

Please use C# to implement the complete code without the Main function. Please follow the following type definitions:

```csharp
using xxx
...
class DataAnalysis
{
    public ;
    {
        // Implement your code here.
    }
}
```


using System.Security.Cryptography;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Text.RegularExpressions;

#<INSERT>

class TextFilterTest
{
    public static int Main(string[] args)
    {
        bool allTestsPassed = true;

        // Test Case 1
        string result1 = TextFilter.RemoveDigits("Hello123World!");
        if (result1 != "HelloWorld!")
        {
            Console.WriteLine("Test 1 Failed");
            allTestsPassed = false;
        }
        else
        {
            Console.WriteLine("Test 1 Passed");
        }

        // Test Case 2
        string result2 = TextFilter.RemoveDigits("2023NewYear!");
        if (result2 != "NewYear!")
        {
            Console.WriteLine("Test 2 Failed");
            allTestsPassed = false;
        }
        else
        {
            Console.WriteLine("Test 2 Passed");
        }

        // Test Case 3
        string result3 = TextFilter.RemoveDigits("NoDigitsHere");
        if (result3 != "NoDigitsHere")
        {
            Console.WriteLine("Test 3 Failed");
            allTestsPassed = false;
        }
        else
        {
            Console.WriteLine("Test 3 Passed");
        }

        // Test Case 4
        string result4 = TextFilter.RemoveDigits("1234567890");
        if (result4 != "")
        {
            Console.WriteLine("Test 4 Failed");
            allTestsPassed = false;
        }
        else
        {
            Console.WriteLine("Test 4 Passed");
        }

        // Test Case 5
        string result5 = TextFilter.RemoveDigits("!@#$%^&*()");
        if (result5 != "!@#$%^&*()")
        {
            Console.WriteLine("Test 5 Failed");
            allTestsPassed = false;
        }
        else
        {
            Console.WriteLine("Test 5 Passed");
        }

        if (allTestsPassed)
        {
            return 0;
        }
        else
        {
            return -1;
        }
    }
}

using System.Security.Cryptography;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Text.RegularExpressions;
class TextFilter
{
    public static string RemoveDigits(string input)
    {
        return Regex.Replace(input, @"\d", "");
    }

    private static void CheckFunction()
    {
        Console.WriteLine(RemoveDigits("Hello123World!") == "HelloWorld!" ? "Test 1 Passed" : "Test 1 Failed");
        Console.WriteLine(RemoveDigits("2023NewYear!") == "NewYear!" ? "Test 2 Passed" : "Test 2 Failed");
        Console.WriteLine(RemoveDigits("NoDigitsHere") == "NoDigitsHere" ? "Test 3 Passed" : "Test 3 Failed");
    }
}

Imagine you're working on a text processing tool and you've been tasked with creating a function that filters out all the digits from a given string, leaving only the non-digit characters. This function should take a single string as input and return a new string that contains only the letters and special characters from the original string, with all the digits removed. For example, if the input string is "Hello123World!", the function should return "HelloWorld!".

Write a self-contained C# program that includes this functionality. Make sure to include all necessary imports at the beginning of your code snippet. Additionally, design a check function with provided data points to verify the correctness of your solution. Aim to make the code snippet and function names as distinct as possible from the given Rust code snippet.

Please use C# to implement the complete code without the Main function. Please follow the following type definitions:

```csharp
using xxx
...
class TextFilter
{
    public static string RemoveDigits(string input)
    {
        // Implement your code here.
    }
}
```


using System.Security.Cryptography;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using System.Numerics;
using System;

#<INSERT>

class TransactionValidatorTest {
    public static int Main(string[] args) {
        bool allTestsPassed = true;

        // Test Case 1
        bool result1 = TransactionValidator.HasPrimeDigit(2347);
        if (result1 != true) {
            Console.WriteLine("Test Case 1 Failed");
            allTestsPassed = false;
        }

        // Test Case 2
        bool result2 = TransactionValidator.HasPrimeDigit(4680);
        if (result2 != false) {
            Console.WriteLine("Test Case 2 Failed");
            allTestsPassed = false;
        }

        // Test Case 3
        bool result3 = TransactionValidator.HasPrimeDigit(1111);
        if (result3 != false) {
            Console.WriteLine("Test Case 3 Failed");
            allTestsPassed = false;
        }

        // Test Case 4
        bool result4 = TransactionValidator.HasPrimeDigit(3579);
        if (result4 != true) {
            Console.WriteLine("Test Case 4 Failed");
            allTestsPassed = false;
        }

        // Test Case 5
        bool result5 = TransactionValidator.HasPrimeDigit(2024);
        if (result5 != true) {
            Console.WriteLine("Test Case 5 Failed");
            allTestsPassed = false;
        }

        if (allTestsPassed) {
            Console.WriteLine("All test cases passed!");
            return 0;
        } else {
            return -1;
        }
    }
}

using System.Security.Cryptography;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using System.Numerics;
using System;
class TransactionValidator {
    public static bool HasPrimeDigit(long transactionId) {
        string transactionIdStr = transactionId.ToString();
        foreach (char digit in transactionIdStr) {
            if (digit == '2' || digit == '3' || digit == '5' || digit == '7') {
                return true;
            }
        }
        return false;
    }
    public static void CheckFunction() {
        Debug.Assert(HasPrimeDigit(2347) == true, "2347 contains prime digits.");
        Debug.Assert(HasPrimeDigit(4680) == false, "4680 does not contain any prime digits.");
        Debug.Assert(HasPrimeDigit(1111) == false, "1111 does not contain any prime digits.");
        Debug.Assert(HasPrimeDigit(3579) == true, "3579 contains prime digits.");
        Console.WriteLine("All test cases passed!");
    }

}

Suppose you are working on a financial application that requires the analysis of transaction IDs to ensure their validity based on a specific criterion. Your task is to write a C# method that identifies whether a given transaction ID, represented as a long integer, contains at least one prime digit (2, 3, 5, or 7). The method should return `true` if there is at least one prime digit in the transaction ID and `false` otherwise. For instance, a transaction ID of `2347` should return `true` because it contains the prime digits 2, 3, and 7, while a transaction ID of `4680` should return `false` as it contains no prime digits.

Please use C# to implement the complete code without the Main function. Please follow the following type definitions:

```csharp
using xxx
...
class TransactionValidator
{
    public static bool HasPrimeDigit(long transactionId) {
    {
        // Implement your code here.
    }
}
```


using System;
using System.Globalization;

#<INSERT>

public class ValueComparerTest
{
    public static int Main()
    {
        bool allTestsPassed = true;

        // Test case 1: Integer comparison
        if (!CompareAndCheck(5, 10, 10))
        {
            allTestsPassed = false;
            Console.WriteLine("Test case 1 failed.");
        }

        // Test case 2: Floating-point comparison
        if (!CompareAndCheck(5.5, 3.3, 5.5))
        {
            allTestsPassed = false;
            Console.WriteLine("Test case 2 failed.");
        }

        // Test case 3: String that represents numbers (dot as decimal separator)
        if (!CompareAndCheck("2.5", "2.55", "2.55"))
        {
            allTestsPassed = false;
            Console.WriteLine("Test case 3 failed.");
        }

        // Test case 4: String that represents numbers (comma as decimal separator)
        if (!CompareAndCheck("3,14", "3,1", "3,14"))
        {
            allTestsPassed = false;
            Console.WriteLine("Test case 4 failed.");
        }

        // Test case 5: Equal values
        if (!CompareAndCheck("100", 100, "None"))
        {
            allTestsPassed = false;
            Console.WriteLine("Test case 5 failed.");
        }

        return allTestsPassed ? 0 : -1;
    }

    private static bool CompareAndCheck(object value1, object value2, object expected)
    {
        object result = ValueComparer.CompareValues(value1, value2);
        return result.Equals(expected);
    }
}

using System;
using System.Globalization;

public class ValueComparer
{
    public static object CompareValues(object value1, object value2)
    {
        if (value1 == null || value2 == null)
        {
            throw new ArgumentNullException("Values cannot be null");
        }

        // Convert values to comparable double, if possible
        double doubleValue1, doubleValue2;
        if (TryConvertToDouble(value1, out doubleValue1) && TryConvertToDouble(value2, out doubleValue2))
        {
            if (doubleValue1 > doubleValue2)
            {
                return value1;
            }
            else if (doubleValue1 < doubleValue2)
            {
                return value2;
            }
            else
            {
                return "None";
            }
        }

        // Handle string comparison
        if (value1 is string && value2 is string)
        {
            int stringComparison = string.Compare((string)value1, (string)value2, StringComparison.Ordinal);
            if (stringComparison > 0)
            {
                return value1;
            }
            else if (stringComparison < 0)
            {
                return value2;
            }
            else
            {
                return "None";
            }
        }

        // Handle comparison of other types (e.g., integers)
        if (value1 is IComparable comparable1 && value2 is IComparable comparable2)
        {
            int comparisonResult = comparable1.CompareTo(comparable2);
            if (comparisonResult > 0)
            {
                return value1;
            }
            else if (comparisonResult < 0)
            {
                return value2;
            }
            else
            {
                return "None";
            }
        }

        throw new ArgumentException("Values are not comparable");
    }

    private static bool TryConvertToDouble(object value, out double result)
    {
        if (value is double)
        {
            result = (double)value;
            return true;
        }

        if (value is float)
        {
            result = (float)value;
            return true;
        }

        if (value is int)
        {
            result = (int)value;
            return true;
        }

        if (value is string strValue)
        {
            // Try parsing with dot and comma as decimal separators
            if (double.TryParse(strValue, NumberStyles.Float, CultureInfo.InvariantCulture, out result) ||
                double.TryParse(strValue, NumberStyles.Float, new CultureInfo("fr-FR"), out result))
            {
                return true;
            }
        }

        result = 0;
        return false;
    }
}

Imagine you're working on a program that needs to compare two values. These values could be integers, floating-point numbers, or even strings that represent numbers (with either a dot or a comma as the decimal separator). Your task is to write a function that determines which of the two values is larger and returns it in its original form (type and format). If the two values are equal, the function should return the string "None". Can you design a function that handles this comparison elegantly, considering the different possible input types?

Please use C# to implement the complete code without the Main function. Please follow the following type definitions:

```csharp
using xxx
...
class ValueComparer
{
public class ValueComparer
    {
        // Implement your code here.
    }
}
```


using System.Security.Cryptography;
using System.Text;
using System.Linq;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Collections.Generic;

#<INSERT>

class DataAnalyzerTest
{
    public static int Main(string[] args)
    {
        bool allTestsPassed = true;

        // Test Case 1
        List<int> input1 = new List<int> { 5, 3, 6, 2, 4, 1 };
        List<int> expected1 = new List<int> { 5, 3, 3, 2, 2, 1 };
        List<int> result1 = DataAnalyzer.CumulativeMin(input1);
        if (!result1.SequenceEqual(expected1))
        {
            Console.WriteLine("Test Case 1 Failed");
            allTestsPassed = false;
        }

        // Test Case 2
        List<int> input2 = new List<int> { 1, 2, 3, 4, 5, 6 };
        List<int> expected2 = new List<int> { 1, 1, 1, 1, 1, 1 };
        List<int> result2 = DataAnalyzer.CumulativeMin(input2);
        if (!result2.SequenceEqual(expected2))
        {
            Console.WriteLine("Test Case 2 Failed");
            allTestsPassed = false;
        }

        // Test Case 3
        List<int> input3 = new List<int> { 10, 9, 8, 7, 6, 5 };
        List<int> expected3 = new List<int> { 10, 9, 8, 7, 6, 5 };
        List<int> result3 = DataAnalyzer.CumulativeMin(input3);
        if (!result3.SequenceEqual(expected3))
        {
            Console.WriteLine("Test Case 3 Failed");
            allTestsPassed = false;
        }

        // Test Case 4
        List<int> input4 = new List<int> { -1, -3, -2, -5, -4 };
        List<int> expected4 = new List<int> { -1, -3, -3, -5, -5 };
        List<int> result4 = DataAnalyzer.CumulativeMin(input4);
        if (!result4.SequenceEqual(expected4))
        {
            Console.WriteLine("Test Case 4 Failed");
            allTestsPassed = false;
        }

        // Test Case 5
        List<int> input5 = new List<int> { };
        List<int> expected5 = new List<int> { };
        List<int> result5 = DataAnalyzer.CumulativeMin(input5);
        if (!result5.SequenceEqual(expected5))
        {
            Console.WriteLine("Test Case 5 Failed");
            allTestsPassed = false;
        }

        if (allTestsPassed)
        {
            Console.WriteLine("All test cases passed.");
            return 0;
        }
        else
        {
            return -1;
        }
    }
}

using System.Security.Cryptography;
using System.Text;
using System.Linq;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Collections.Generic;
class DataAnalyzer
{
    public static List<int> CumulativeMin(List<int> numbers)
    {
        List<int> cumulativeMins = new List<int>();
        if (numbers.Count == 0)
        {
            return cumulativeMins;
        }
        int currentMin = numbers[0];
        foreach (int number in numbers)
        {
            if (number < currentMin)
            {
                currentMin = number;
            }
            cumulativeMins.Add(currentMin);
        }
        return cumulativeMins;
    }
    ;
        List<int> result = CumulativeMin(sampleData);
        Console.WriteLine("Cumulative minimums: " + string.Join(", ", result));
    }
}

Imagine you're working on a data analysis tool and you need to implement a feature that tracks the cumulative minimum value in a sequence of numbers. This feature should take a list of integers as input and return a new list where each element represents the minimum value encountered up to that point in the sequence. For example, if the input list is `[5, 3, 6, 2, 4, 1]`, the output should be `[5, 3, 3, 2, 2, 1]`, indicating that at each step, the minimum value seen so far is updated. How would you write a function in C# to accomplish this task?

Please use C# to implement the complete code without the Main function. Please follow the following type definitions:

```csharp
using xxx
...
class DataAnalyzer
{
    public static List<int> CumulativeMin(List<int> numbers)
    {
        // Implement your code here.
    }
}
```


using System.Security.Cryptography;
using System.Text;
using System.Linq;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Collections.Generic;

#<INSERT>

class ListModifierTest {
    public static int Main(string[] args) {
        var testCases = new List<List<int>> {
            new List<int>{2, 3, 4},
            new List<int>{1, 5, 7, 9},
            new List<int>{0, 0, 0},
            new List<int>{-1, -2, -3},
            new List<int>{10, 20, 30}
        };

        var expectedResults = new List<List<int>> {
            new List<int>{4, 6, 8},
            new List<int>{2, 10, 14, 18},
            new List<int>{0, 0, 0},
            new List<int>{-2, -4, -6},
            new List<int>{20, 40, 60}
        };

        bool allPassed = true;

        for (int i = 0; i < testCases.Count; i++) {
            var result = ListModifier.DoubleElements(testCases[i]);
            if (result.SequenceEqual(expectedResults[i])) {
                Console.WriteLine($"Test case {i + 1}: Passed");
            } else {
                Console.WriteLine($"Test case {i + 1}: Failed");
                allPassed = false;
            }
        }

        return allPassed ? 0 : -1;
    }
}

using System.Security.Cryptography;
using System.Text;
using System.Linq;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Collections.Generic;
class ListModifier {
    public static List<int> DoubleElements(List<int> inputList) {
        for (int i = 0; i < inputList.Count; i++) {
            inputList[i] *= 2;
        }
        return inputList;
    }
    public static void CheckFunction() {
        var testCases = new List<List<int>> {
            new List<int>{2, 3, 4},
            new List<int>{1, 5, 7, 9},
            new List<int>{0, 0, 0}
        };
        var expectedResults = new List<List<int>> {
            new List<int>{4, 6, 8},
            new List<int>{2, 10, 14, 18},
            new List<int>{0, 0, 0}
        };
        for (int i = 0; i < testCases.Count; i++) {
            var result = DoubleElements(testCases[i]);
            if (result.SequenceEqual(expectedResults[i])) {
                Console.WriteLine($"Test case {i + 1}: Passed");
            } else {
                Console.WriteLine($"Test case {i + 1}: Failed");
            }
        }
    }

}

Can you write a C# method that doubles each element in a given list of integers and returns the modified list? For example, if you pass a list containing [2, 3, 4], the method should return a list containing [4, 6, 8]. Ensure your code is self-contained and includes necessary imports.

Please use C# to implement the complete code without the Main function. Please follow the following type definitions:

```csharp
using xxx
...
class ListModifier
{
    public static List<int> DoubleElements(List<int> inputList) {
    {
        // Implement your code here.
    }
}
```


using System.Security.Cryptography;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using System.Numerics;
using System;

#<INSERT>

class FinancialCalculatorTest {
    public static int Main(string[] args) {
        bool allTestsPassed = true;

        // Test Case 1
        allTestsPassed &= FinancialCalculator.NearestWholeNumber("10") == 10;

        // Test Case 2
        allTestsPassed &= FinancialCalculator.NearestWholeNumber("15.3") == 15;

        // Test Case 3
        allTestsPassed &= FinancialCalculator.NearestWholeNumber("14.5") == 15;

        // Test Case 4
        allTestsPassed &= FinancialCalculator.NearestWholeNumber("-14.5") == -15;

        // Test Case 5
        allTestsPassed &= FinancialCalculator.NearestWholeNumber("-10.1") == -10;

        return allTestsPassed ? 0 : -1;
    }
}

using System.Security.Cryptography;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using System.Numerics;
using System;
class FinancialCalculator {
    public static long NearestWholeNumber(string value) {
        decimal number = decimal.Parse(value);
        decimal fractionalPart = number % 1;
        if (fractionalPart == 0.5m || fractionalPart == -0.5m) {
            return (long)(number + Math.Sign(number) * 0.5m);
        } else {
            return (long)Math.Round(number);
        }
    }
    public static void Check() {
        Console.WriteLine(NearestWholeNumber("10") == 10);
        Console.WriteLine(NearestWholeNumber("15.3") == 15);
        Console.WriteLine(NearestWholeNumber("14.5") == 15);
        Console.WriteLine(NearestWholeNumber("-14.5") == -15);
    }
}
class Program {

}

Imagine you're working on a financial application where precision is key, and you need to implement a feature that deals with user inputs in the form of strings representing monetary values. Your task is to write a method that takes these string inputs, which could be either whole numbers or decimal numbers, and converts them into the nearest whole number. However, there's a twist: if the decimal part of the number is exactly .5, you should round the number away from zero, meaning 2.5 becomes 3 and -2.5 becomes -3. Can you craft a method that handles this rounding strategy?

Please use C# to implement the complete code without the Main function. Please follow the following type definitions:

```csharp
using xxx
...
class FinancialCalculator
{
    public static long NearestWholeNumber(string value) {
    {
        // Implement your code here.
    }
}
```


using System.Security.Cryptography;
using System.Text;
using System.Collections.Generic;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Linq;

#<INSERT>

class EvenDigitSumCalculatorTest {
    public static int Main(string[] args) {
        bool allTestsPassed = true;

        // Test case 1
        int result1 = EvenDigitSumCalculator.CalculateEvenDigitSum(246);
        if (result1 != 12) {
            Console.WriteLine($"Test 1 failed: Expected 12, but got {result1}");
            allTestsPassed = false;
        }

        // Test case 2
        int result2 = EvenDigitSumCalculator.CalculateEvenDigitSum(135);
        if (result2 != 0) {
            Console.WriteLine($"Test 2 failed: Expected 0, but got {result2}");
            allTestsPassed = false;
        }

        // Test case 3
        int result3 = EvenDigitSumCalculator.CalculateEvenDigitSum(123456789);
        if (result3 != 20) {
            Console.WriteLine($"Test 3 failed: Expected 20, but got {result3}");
            allTestsPassed = false;
        }

        // Test case 4
        int result4 = EvenDigitSumCalculator.CalculateEvenDigitSum(2222);
        if (result4 != 8) {
            Console.WriteLine($"Test 4 failed: Expected 8, but got {result4}");
            allTestsPassed = false;
        }

        // Test case 5
        int result5 = EvenDigitSumCalculator.CalculateEvenDigitSum(1111);
        if (result5 != 0) {
            Console.WriteLine($"Test 5 failed: Expected 0, but got {result5}");
            allTestsPassed = false;
        }

        if (allTestsPassed) {
            Console.WriteLine("All tests passed successfully.");
            return 0;
        } else {
            return -1;
        }
    }
}

using System.Security.Cryptography;
using System.Text;
using System.Collections.Generic;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Linq;
class EvenDigitSumCalculator {
    public static int CalculateEvenDigitSum(int number) {
        return number.ToString().Where(char.IsDigit).Select(digit => int.Parse(digit.ToString())).Where(digit => digit % 2 == 0).Sum();
    }

}

Imagine you're working on a project where you need to analyze numbers in a unique way. Your task is to write a program that, given a positive integer, calculates the sum of its even digits. If the number contains only odd digits, the program should return 0. This might seem straightforward, but it's a crucial part of your data analysis tool. Can you craft a solution that efficiently computes this?

For instance, if the input number is 246, the program should return 12 since 2 + 4 + 6 = 12. If the input is 135, the program should return 0 because all digits are odd.

Please use C# to implement the complete code without the Main function. Please follow the following type definitions:

```csharp
using xxx
...
class EvenDigitSumCalculator
{
    public static int CalculateEvenDigitSum(int number) {
    {
        // Implement your code here.
    }
}
```


using System.Security.Cryptography;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Text.RegularExpressions;

#<INSERT>

class TextFormatterTest {
    static int Main(string[] args) {
        bool allTestsPassed = true;

        // Test cases
        var testCases = new Dictionary<string, string> {
            { "Hello World", "Hello+World" },
            { "  Leading spaces", "*Leading+spaces" },
            { "Trailing spaces  ", "Trailing+spaces*" },
            { "Multiple   spaces", "Multiple*spaces" },
            { "NoExtraSpaces", "NoExtraSpaces" }
        };

        foreach (var testCase in testCases) {
            string input = testCase.Key;
            string expected = testCase.Value;
            string result = TextFormatter.FormatForUrl(input);
            if (result != expected) {
                Console.WriteLine($"Test Failed: Input: '{input}', Expected: '{expected}', Got: '{result}'");
                allTestsPassed = false;
            }
        }

        if (allTestsPassed) {
            Console.WriteLine("All tests passed!");
            return 0;
        } else {
            return -1;
        }
    }
}

using System.Security.Cryptography;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Text.RegularExpressions;
class TextFormatter {
    public static string FormatForUrl(string input) {
        string result = Regex.Replace(input, @"\s{2,}", "*");
        result = result.Replace(" ", "+");
        return result;
    }

}

Imagine you're working on a text processing application where you need to clean up user input. Specifically, you're tasked with formatting strings to make them URL-friendly. Your challenge is to write a method that takes a string as input and applies the following transformations:

1. Replace all spaces with plus signs (`+`).
2. If the string contains more than two consecutive spaces, replace all these consecutive spaces with a single asterisk (`*`).

For example, if a user inputs a string with irregular spacing, your method should tidy it up according to these rules, making it more structured and predictable for further processing.

Can you write a C# method that accomplishes this task?

Please use C# to implement the complete code without the Main function. Please follow the following type definitions:

```csharp
using xxx
...
class TextFormatter
{
    public static string FormatForUrl(string input) {
    {
        // Implement your code here.
    }
}
```


using System.Security.Cryptography;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Text.RegularExpressions;

#<INSERT>

class InventoryManagerTest {
    public static int Main(string[] args) {
        bool allTestsPassed = true;

        // Test case 1
        long result1 = InventoryManager.CalculatePeaches("4 bananas and 5 grapes", 15);
        if (result1 != 6) {
            Console.WriteLine($"Test case 1 failed: expected 6, got {result1}");
            allTestsPassed = false;
        }

        // Test case 2
        long result2 = InventoryManager.CalculatePeaches("0 bananas and 1 grapes", 3);
        if (result2 != 2) {
            Console.WriteLine($"Test case 2 failed: expected 2, got {result2}");
            allTestsPassed = false;
        }

        // Test case 3
        long result3 = InventoryManager.CalculatePeaches("2 bananas and 3 grapes", 100);
        if (result3 != 95) {
            Console.WriteLine($"Test case 3 failed: expected 95, got {result3}");
            allTestsPassed = false;
        }

        // Test case 4
        long result4 = InventoryManager.CalculatePeaches("100 bananas and 1 grapes", 120);
        if (result4 != 19) {
            Console.WriteLine($"Test case 4 failed: expected 19, got {result4}");
            allTestsPassed = false;
        }

        // Test case 5
        long result5 = InventoryManager.CalculatePeaches("10 bananas and 20 grapes", 50);
        if (result5 != 20) {
            Console.WriteLine($"Test case 5 failed: expected 20, got {result5}");
            allTestsPassed = false;
        }

        if (allTestsPassed) {
            Console.WriteLine("All test cases passed successfully.");
            return 0;
        } else {
            return -1;
        }
    }
}

using System.Security.Cryptography;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Text.RegularExpressions;
class InventoryManager {
    public static long CalculatePeaches(string fruitCounts, long totalFruits) {
        var numbers = Regex.Matches(fruitCounts, @"\d+").Cast<Match>().Select(m => long.Parse(m.Value)).ToArray();
        long bananas = numbers[0];
        long grapes = numbers[1];
        long peaches = totalFruits - (bananas + grapes);
        return peaches;
    }
    public static void Check() {
        Debug.Assert(CalculatePeaches("4 bananas and 5 grapes", 15) == 6);
        Debug.Assert(CalculatePeaches("0 bananas and 1 grapes", 3) == 2);
        Debug.Assert(CalculatePeaches("2 bananas and 3 grapes", 100) == 95);
        Debug.Assert(CalculatePeaches("100 bananas and 1 grapes", 120) == 19);
        Console.WriteLine("All test cases passed successfully.");
    }

}

Imagine you're working on a software that helps manage a grocery store's inventory. You've been tasked with writing a piece of code that calculates the number of a specific fruit, let's say bananas, in a mixed fruit basket. The basket contains a mix of bananas, grapes, and peaches. You're given a string that represents the total number of bananas and grapes in the basket, and an integer that represents the total number of fruits in the basket. Your job is to return the number of peaches in the basket.

For example, if the input string says "4 bananas and 5 grapes", and the total number of fruits in the basket is 15, your code should return 6, indicating there are 6 peaches in the basket.

Can you write a C# function that solves this problem?

Please use C# to implement the complete code without the Main function. Please follow the following type definitions:

```csharp
using xxx
...
class InventoryManager
{
    public static long CalculatePeaches(string fruitCounts, long totalFruits) {
    {
        // Implement your code here.
    }
}
```


using System.Security.Cryptography;
using System.Text;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Collections.Generic;
using System.Linq;

#<INSERT>

class PositiveFilterTest
{
    /// <summary>
    /// Checks if the FilterPositiveIntegers method returns the correct result.
    /// </summary>
    /// <param name="input">The input list to filter.</param>
    /// <param name="expected">The expected result after filtering.</param>
    /// <returns>True if the test passes, false otherwise.</returns>
    static bool CheckFunction(List<int> input, List<int> expected)
    {
        List<int> result = PositiveFilter.FilterPositiveIntegers(input);
        bool isCorrect = result.SequenceEqual(expected);
        Console.WriteLine($"Input: {string.Join(", ", input)}");
        Console.WriteLine($"Expected: {string.Join(", ", expected)}");
        Console.WriteLine($"Result: {string.Join(", ", result)}");
        Console.WriteLine(isCorrect ? "Test Passed" : "Test Failed");
        Console.WriteLine();
        return isCorrect;
    }

    static void Main()
    {
        bool allTestsPassed = true;

        allTestsPassed &= CheckFunction(new List<int> { -1, 2, -4, 5, 6 }, new List<int> { 2, 5, 6 });
        allTestsPassed &= CheckFunction(new List<int> { 5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10 }, new List<int> { 5, 3, 2, 3, 9, 123, 1 });
        allTestsPassed &= CheckFunction(new List<int> { -1, -2, -3, -4, -5 }, new List<int> { });
        allTestsPassed &= CheckFunction(new List<int> { 1, 2, 3, 4, 5 }, new List<int> { 1, 2, 3, 4, 5 });

        if (allTestsPassed)
        {
            Console.WriteLine("All tests passed.");
            Environment.Exit(0);
        }
        else
        {
            Console.WriteLine("Some tests failed.");
            Environment.Exit(-1);
        }
    }
}

using System.Security.Cryptography;
using System.Text;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Collections.Generic;
using System.Linq;
class PositiveFilter
{
    public static List<int> FilterPositiveIntegers(List<int> numbers)
    {
        return numbers.Where(n => n > 0).ToList();
    }
}
class Program
{
    , new List<int> { 2, 5, 6 });
        CheckFunction(new List<int> { 5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10 }, new List<int> { 5, 3, 2, 3, 9, 123, 1 });
    }
    static void CheckFunction(List<int> input, List<int> expected)
    {
        List<int> result = PositiveFilter.FilterPositiveIntegers(input);
        bool isCorrect = result.SequenceEqual(expected);
        Console.WriteLine($"Input: {string.Join(", ", input)}");
        Console.WriteLine($"Expected: {string.Join(", ", expected)}");
        Console.WriteLine($"Result: {string.Join(", ", result)}");
        Console.WriteLine(isCorrect ? "Test Passed" : "Test Failed");
        Console.WriteLine();
    }
}

Hey there! I've got a little coding challenge for you in C#. Can you write a method that filters out all the non-positive integers from a list and returns a new list containing only the positive ones? Make sure to include all the necessary imports at the beginning of your code snippet. Also, please provide a check function with some test cases to ensure your solution works as expected. Let's see what you've got!

Please use C# to implement the complete code without the Main function. Please follow the following type definitions:

```csharp
using xxx
...
class PositiveFilter
{
    public static List<int> FilterPositiveIntegers(List<int> numbers)
    {
        // Implement your code here.
    }
}
```


using System.Security.Cryptography;
using System.Text;
using System.Linq;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Collections.Generic;

#<INSERT>

class CharacterFrequencyAnalyzerTest
{
    public static int Main(string[] args)
    {
        var testCases = new List<Tuple<string, Dictionary<char, int>>>
        {
            new Tuple<string, Dictionary<char, int>>("hello world", new Dictionary<char, int> { {'h', 1}, {'e', 1}, {'l', 3}, {'o', 2}, {' ', 1}, {'w', 1}, {'r', 1}, {'d', 1} }),
            new Tuple<string, Dictionary<char, int>>("aabbcc", new Dictionary<char, int> { {'a', 2}, {'b', 2}, {'c', 2} }),
            new Tuple<string, Dictionary<char, int>>("123321", new Dictionary<char, int> { {'1', 2}, {'2', 2}, {'3', 2} }),
            new Tuple<string, Dictionary<char, int>>("", new Dictionary<char, int> { }),
            new Tuple<string, Dictionary<char, int>>("abcde", new Dictionary<char, int> { {'a', 1}, {'b', 1}, {'c', 1}, {'d', 1}, {'e', 1} })
        };

        foreach (var testCase in testCases)
        {
            var result = CharacterFrequencyAnalyzer.AnalyzeCharacterFrequency(testCase.Item1);
            if (!IsEqual(result, testCase.Item2))
            {
                Console.WriteLine($"Test Failed for input: {testCase.Item1}");
                return -1;
            }
        }

        Console.WriteLine("All tests passed.");
        return 0;
    }

    private static bool IsEqual(Dictionary<char, int> dict1, Dictionary<char, int> dict2)
    {
        if (dict1.Count != dict2.Count) return false;

        foreach (var pair in dict1)
        {
            if (!dict2.ContainsKey(pair.Key) || dict2[pair.Key] != pair.Value)
            {
                return false;
            }
        }

        return true;
    }
}

using System.Security.Cryptography;
using System.Text;
using System.Linq;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Collections.Generic;
class CharacterFrequencyAnalyzer
{
    public static Dictionary<char, int> AnalyzeCharacterFrequency(string input)
    {
        Dictionary<char, int> characterFrequencies = new Dictionary<char, int>();
        foreach (char character in input)
        {
            if (characterFrequencies.ContainsKey(character))
            {
                characterFrequencies[character]++;
            }
            else
            {
                characterFrequencies.Add(character, 1);
            }
        }
        return characterFrequencies;
    }
    public static void CheckFunction()
    {
        var testString = "hello world";
        var expectedResult = new Dictionary<char, int> { {'h', 1}, {'e', 1}, {'l', 3}, {'o', 2}, {' ', 1}, {'w', 1}, {'r', 1}, {'d', 1} };
        var result = AnalyzeCharacterFrequency(testString);
        Console.WriteLine("Testing with input: " + testString);
        foreach (var pair in expectedResult)
        {
            if (!result.ContainsKey(pair.Key) || result[pair.Key] != pair.Value)
            {
                Console.WriteLine("Test Failed.");
                return;
            }
        }
        Console.WriteLine("Test Passed.");
    }

}

Imagine you're working on a project that requires you to analyze text data. One of the tasks you need to accomplish is to determine the frequency of each character in a given string. However, to make your analysis more insightful, you're interested in only the unique characters and their counts. Your challenge is to write a C# program that takes a string as input and returns a dictionary where each key is a unique character from the string, and the corresponding value is the number of times that character appears in the string.

For example, if the input string is "hello world", the output should be a dictionary that includes entries like {'h': 1, 'e': 1, 'l': 3, 'o': 2, ...}.

Ensure your solution is efficient and handles edge cases, such as an empty string, gracefully.

Please use C# to implement the complete code without the Main function. Please follow the following type definitions:

```csharp
using xxx
...
class CharacterFrequencyAnalyzer
{
    public static Dictionary<char, int> AnalyzeCharacterFrequency(string input)
    {
        // Implement your code here.
    }
}
```


using System.Security.Cryptography;
using System.Text;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Collections.Generic;
using System.Linq;

#<INSERT>

class DataAnalyzerTest
{
    public static int Main(string[] args)
    {
        bool allTestsPassed = true;

        // Test case 1
        List<int> testData1 = new List<int> { 5, 3, 5, 2, 3, 3, 9, 0, 123 };
        List<int> expectedResult1 = new List<int> { 0, 2, 3, 5, 9, 123 };
        List<int> result1 = DataAnalyzer.GetUniqueSortedNumbers(testData1);
        allTestsPassed &= result1.SequenceEqual(expectedResult1);

        // Test case 2
        List<int> testData2 = new List<int> { 1, 2, 3, 4, 5 };
        List<int> expectedResult2 = new List<int> { 1, 2, 3, 4, 5 };
        List<int> result2 = DataAnalyzer.GetUniqueSortedNumbers(testData2);
        allTestsPassed &= result2.SequenceEqual(expectedResult2);

        // Test case 3
        List<int> testData3 = new List<int> { 9, 7, 5, 3, 1, 1, 3, 5, 7, 9 };
        List<int> expectedResult3 = new List<int> { 1, 3, 5, 7, 9 };
        List<int> result3 = DataAnalyzer.GetUniqueSortedNumbers(testData3);
        allTestsPassed &= result3.SequenceEqual(expectedResult3);

        // Test case 4
        List<int> testData4 = new List<int> { -1, -2, -3, -4, -5, -1, -2, -3, -4, -5 };
        List<int> expectedResult4 = new List<int> { -5, -4, -3, -2, -1 };
        List<int> result4 = DataAnalyzer.GetUniqueSortedNumbers(testData4);
        allTestsPassed &= result4.SequenceEqual(expectedResult4);

        // Test case 5
        List<int> testData5 = new List<int> { };
        List<int> expectedResult5 = new List<int> { };
        List<int> result5 = DataAnalyzer.GetUniqueSortedNumbers(testData5);
        allTestsPassed &= result5.SequenceEqual(expectedResult5);

        if (allTestsPassed)
        {
            return 0;
        }
        else
        {
            return -1;
        }
    }
}

using System.Security.Cryptography;
using System.Text;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Collections.Generic;
using System.Linq;
class DataAnalyzer
{
    public static List<int> GetUniqueSortedNumbers(List<int> numbers)
    {
        HashSet<int> uniqueNumbers = new HashSet<int>(numbers);
        List<int> sortedUniqueNumbers = uniqueNumbers.ToList();
        sortedUniqueNumbers.Sort();
        return sortedUniqueNumbers;
    }
    public static void CheckFunction()
    {
        List<int> testData = new List<int> { 5, 3, 5, 2, 3, 3, 9, 0, 123 };
        List<int> expectedResult = new List<int> { 0, 2, 3, 5, 9, 123 };
        List<int> result = GetUniqueSortedNumbers(testData);
        Console.WriteLine($"Test Result: { (result.SequenceEqual(expectedResult) ? "Success" : "Failure") }");
    }

}

Imagine you're working on a project where you need to analyze a collection of data points, specifically integers, for patterns. However, your analysis requires that each data point is unique and presented in ascending order to make the pattern recognition process more efficient. You decide to write a C# method that takes a list of integers as input, removes any duplicates, and then returns a new list with only unique elements sorted in ascending order. How would you design such a method in C#, ensuring it's efficient and follows best coding practices?

Please use C# to implement the complete code without the Main function. Please follow the following type definitions:

```csharp
using xxx
...
class DataAnalyzer
{
    public static List<int> GetUniqueSortedNumbers(List<int> numbers)
    {
        // Implement your code here.
    }
}
```


using System.Security.Cryptography;
using System.Text;
using System.Linq;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Collections.Generic;

#<INSERT>

class GradeConverterTest {
    public static int Main(string[] args) {
        bool allTestsPassed = true;

        // Test Case 1
        List<int> input1 = new List<int> { 100, 92, 87, 81, 76, 71, 66, 61, 56, 51, 46, 41, 35 };
        List<string> expected1 = new List<string> { "A+", "A", "A-", "B+", "B", "B-", "C+", "C", "C-", "D+", "D", "D-", "E" };
        List<string> result1 = GradeConverter.ConvertNumericalToLetterGrades(input1);
        allTestsPassed &= result1.SequenceEqual(expected1);

        // Test Case 2
        List<int> input2 = new List<int> { 85, 70, 55, 40, 39 };
        List<string> expected2 = new List<string> { "A-", "B-", "C-", "D-", "E" };
        List<string> result2 = GradeConverter.ConvertNumericalToLetterGrades(input2);
        allTestsPassed &= result2.SequenceEqual(expected2);

        // Test Case 3
        List<int> input3 = new List<int> { 95, 88, 73, 67, 52 };
        List<string> expected3 = new List<string> { "A", "A-", "B-", "C+", "D+" };
        List<string> result3 = GradeConverter.ConvertNumericalToLetterGrades(input3);
        allTestsPassed &= result3.SequenceEqual(expected3);

        // Test Case 4
        List<int> input4 = new List<int> { 99, 84, 69, 54, 44 };
        List<string> expected4 = new List<string> { "A", "B+", "C+", "D+", "D-" };
        List<string> result4 = GradeConverter.ConvertNumericalToLetterGrades(input4);
        allTestsPassed &= result4.SequenceEqual(expected4);

        return allTestsPassed ? 0 : -1;
    }
}

using System.Security.Cryptography;
using System.Text;
using System.Linq;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Collections.Generic;
class GradeConverter {
    public static List<string> ConvertNumericalToLetterGrades(List<int> numericalGrades) {
        List<string> letterGrades = new List<string>();
        foreach (int grade in numericalGrades) {
            if (grade == 100) letterGrades.Add("A+");
            else if (grade >= 90) letterGrades.Add("A");
            else if (grade >= 85) letterGrades.Add("A-");
            else if (grade >= 80) letterGrades.Add("B+");
            else if (grade >= 75) letterGrades.Add("B");
            else if (grade >= 70) letterGrades.Add("B-");
            else if (grade >= 65) letterGrades.Add("C+");
            else if (grade >= 60) letterGrades.Add("C");
            else if (grade >= 55) letterGrades.Add("C-");
            else if (grade >= 50) letterGrades.Add("D+");
            else if (grade >= 45) letterGrades.Add("D");
            else if (grade >= 40) letterGrades.Add("D-");
            else letterGrades.Add("E");
        }
        return letterGrades;
    }
    public static void TestGradeConversion() {
        List<int> sampleGrades = new List<int> { 100, 92, 87, 81, 76, 71, 66, 61, 56, 51, 46, 41, 35 };
        List<string> expectedLetterGrades = new List<string> { "A+", "A", "A-", "B+", "B", "B-", "C+", "C", "C-", "D+", "D", "D-", "E" };
        List<string> actualLetterGrades = ConvertNumericalToLetterGrades(sampleGrades);
        Console.WriteLine("Expected: " + String.Join(", ", expectedLetterGrades));
        Console.WriteLine("Actual: " + String.Join(", ", actualLetterGrades));
    }

}

Imagine you're a software developer tasked with creating a grading system for a high school teacher. The teacher wants to convert numerical grades into letter grades based on a specific scale. Your job is to write a C# program that takes a list of numerical grades as input and returns the corresponding list of letter grades. The grading scale is as follows:

- **A+**: Exactly 100
- **A**: 90 to 99
- **A-**: 85 to 89
- **B+**: 80 to 84
- **B**: 75 to 79
- **B-**: 70 to 74
- **C+**: 65 to 69
- **C**: 60 to 64
- **C-**: 55 to 59
- **D+**: 50 to 54
- **D**: 45 to 49
- **D-**: 40 to 44
- **E**: Below 40

Your program should be able to handle a list of integers representing the numerical grades and output a list of strings for the letter grades. Make sure to include a function to test the correctness of your grading system with a few sample grades.

Please use C# to implement the complete code without the Main function. Please follow the following type definitions:

```csharp
using xxx
...
class GradeConverter
{
    public static List<string> ConvertNumericalToLetterGrades(List<int> numericalGrades) {
    {
        // Implement your code here.
    }
}
```


#<INSERT>

public class ValueComparerTest
{
    public static int Main(string[] args)
    {
        try
        {
            // Test case 1: Integer comparison
            if (!ValueComparer.CompareValues(5, 3).Equals(5)) return -1;

            // Test case 2: Floating-point comparison
            if (!ValueComparer.CompareValues(2.5, 3.5).Equals(3.5)) return -1;

            // Test case 3: String numbers with dot as decimal separator
            if (!ValueComparer.CompareValues("1.2", "1.3").Equals("1.3")) return -1;

            // Test case 4: String numbers with comma as decimal separator
            if (!ValueComparer.CompareValues("2,5", "2,4").Equals("2,5")) return -1;

            // Test case 5: Equal values
            if (!ValueComparer.CompareValues(7, 7).Equals("None")) return -1;

            return 0; // All test cases passed
        }
        catch (Exception)
        {
            return -1; // Test case failed due to an exception
        }
    }
}

using System;
using System.Globalization;

public class ValueComparer
{
    public static object CompareValues(object value1, object value2)
    {
        if (value1 == null || value2 == null)
        {
            throw new ArgumentNullException("Values cannot be null");
        }

        double num1, num2;
        bool isValue1Numeric = TryParseToDouble(value1, out num1);
        bool isValue2Numeric = TryParseToDouble(value2, out num2);

        if (isValue1Numeric && isValue2Numeric)
        {
            if (num1 > num2) return value1;
            if (num1 < num2) return value2;
            return "None";
        }

        throw new ArgumentException("Both values must be numeric or convertible to numeric.");
    }

    private static bool TryParseToDouble(object value, out double result)
    {
        if (value is int)
        {
            result = Convert.ToDouble(value);
            return true;
        }
        if (value is double)
        {
            result = (double)value;
            return true;
        }
        if (value is string)
        {
            string strValue = (string)value;
            if (double.TryParse(strValue, NumberStyles.Float, CultureInfo.InvariantCulture, out result) ||
                double.TryParse(strValue, NumberStyles.Float, new CultureInfo("fr-FR"), out result))
            {
                return true;
            }
        }
        result = 0;
        return false;
    }
}

Imagine you're working on a program that needs to compare two values. These values could be integers, floating-point numbers, or even strings that represent numbers (with either a dot or a comma as the decimal separator). Your task is to write a function that determines which of the two values is larger and returns it in its original form (type and format). If the two values are equal, your function should return the string "None". Can you craft such a function that handles this comparison gracefully, taking into account the different possible formats and types of the inputs?

Please use C# to implement the complete code without the Main function. Please follow the following type definitions:

```csharp
using xxx
...
class ValueComparer
{
public class ValueComparer
    {
        // Implement your code here.
    }
}
```


using System;

#<INSERT>

public static class ValueComparerTest
{
    public static int Main()
    {
        bool allTestsPassed = true;

        allTestsPassed &= TestEqualIntegers();
        allTestsPassed &= TestDifferentIntegers();
        allTestsPassed &= TestEqualFloatingPoints();
        allTestsPassed &= TestDifferentFloatingPoints();
        allTestsPassed &= TestStringNumbersWithComma();

        return allTestsPassed ? 0 : -1;
    }

    private static bool TestEqualIntegers()
    {
        object result = ValueComparer.CompareValues(5, 5);
        return result.Equals("None");
    }

    private static bool TestDifferentIntegers()
    {
        object result = ValueComparer.CompareValues(3, 7);
        return result.Equals(7);
    }

    private static bool TestEqualFloatingPoints()
    {
        object result = ValueComparer.CompareValues(5.5, 5.5);
        return result.Equals("None");
    }

    private static bool TestDifferentFloatingPoints()
    {
        object result = ValueComparer.CompareValues(3.14, 2.71);
        return result.Equals(3.14);
    }

    private static bool TestStringNumbersWithComma()
    {
        object result = ValueComparer.CompareValues("1,23", "1.22");
        return result.Equals("1,23");
    }
}

using System;
using System.Globalization;

public static class ValueComparer
{
    public static object CompareValues(object value1, object value2)
    {
        if (value1 == null || value2 == null)
        {
            throw new ArgumentNullException("Both values must be non-null.");
        }

        double num1, num2;
        bool isNum1Parsed = TryParseToDouble(value1, out num1);
        bool isNum2Parsed = TryParseToDouble(value2, out num2);

        if (!isNum1Parsed || !isNum2Parsed)
        {
            throw new ArgumentException("Both values must be numeric (either integer, floating-point or numeric strings).");
        }

        if (num1 == num2)
        {
            return "None";
        }

        return num1 > num2 ? value1 : value2;
    }

    private static bool TryParseToDouble(object value, out double result)
    {
        result = 0;

        if (value is double || value is float || value is int || value is long || value is decimal)
        {
            result = Convert.ToDouble(value);
            return true;
        }

        if (value is string strValue)
        {
            strValue = strValue.Replace(",", ".");

            if (double.TryParse(strValue, NumberStyles.Any, CultureInfo.InvariantCulture, out result))
            {
                return true;
            }
        }

        return false;
    }
}

Imagine you're working on a program that needs to compare two values. These values could be integers, floating-point numbers, or even strings that represent numbers (with either a dot or comma as the decimal separator). Your task is to write a function that determines which of the two values is larger and returns it in its original form (type and format). If the two values are equal, your function should return the string "None". Can you craft a function that handles this comparison elegantly, taking into account the different possible types and formats of the inputs?

Please use C# to implement the complete code without the Main function. Please follow the following type definitions:

```csharp
using xxx
...
class ValueComparer
{
public static class ValueComparer
    {
        // Implement your code here.
    }
}
```


using System;

#<INSERT>

public class ValueComparerTest
{
    public static int Main(string[] args)
    {
        bool allTestsPassed = true;

        // Test Case 1: Integer comparison
        if (!CompareTest(5, 10, 10))
        {
            allTestsPassed = false;
        }

        // Test Case 2: Floating-point comparison with dot as decimal separator
        if (!CompareTest(5.5, 3.2, 5.5))
        {
            allTestsPassed = false;
        }

        // Test Case 3: String representation of numbers with dot and comma
        if (!CompareTest("5.5", "5,5", "None"))
        {
            allTestsPassed = false;
        }

        // Test Case 4: Equal integer values
        if (!CompareTest(7, 7, "None"))
        {
            allTestsPassed = false;
        }

        // Test Case 5: String representation of numbers with different decimal separators
        if (!CompareTest("10.25", "10,25", "None"))
        {
            allTestsPassed = false;
        }

        // Return appropriate code based on test results
        return allTestsPassed ? 0 : -1;
    }

    private static bool CompareTest(object value1, object value2, object expected)
    {
        object result = ValueComparer.CompareValues(value1, value2);
        return result.Equals(expected);
    }
}

using System;
using System.Globalization;

public class ValueComparer
{
    public static object CompareValues(object value1, object value2)
    {
        // Attempt to parse the values to numbers
        if (TryParseToDouble(value1, out double num1) && TryParseToDouble(value2, out double num2))
        {
            if (num1 > num2)
            {
                return value1;
            }
            else if (num2 > num1)
            {
                return value2;
            }
            else
            {
                return "None";
            }
        }

        // If parsing fails, compare the values as strings
        string str1 = value1.ToString();
        string str2 = value2.ToString();

        if (str1.CompareTo(str2) > 0)
        {
            return value1;
        }
        else if (str2.CompareTo(str1) > 0)
        {
            return value2;
        }
        else
        {
            return "None";
        }
    }

    private static bool TryParseToDouble(object value, out double result)
    {
        if (value is double || value is float || value is int)
        {
            result = Convert.ToDouble(value);
            return true;
        }
        else if (value is string strValue)
        {
            // Try parsing with dot as decimal separator
            if (double.TryParse(strValue, NumberStyles.Any, CultureInfo.InvariantCulture, out result))
            {
                return true;
            }

            // Try parsing with comma as decimal separator
            if (double.TryParse(strValue, NumberStyles.Any, CultureInfo.GetCultureInfo("fr-FR"), out result))
            {
                return true;
            }
        }

        result = 0;
        return false;
    }
}

Imagine you're working on a program that needs to compare two values. These values could be integers, floating-point numbers, or even strings that represent numbers (with either a dot or a comma as the decimal separator). Your task is to write a function that determines which of the two values is larger and returns it in its original form (type and format). If the two values are equal, the function should return the string "None". Can you design a function that accomplishes this task while handling the different types and formats seamlessly?

Please use C# to implement the complete code without the Main function. Please follow the following type definitions:

```csharp
using xxx
...
class ValueComparer
{
public class ValueComparer
    {
        // Implement your code here.
    }
}
```


using System.Security.Cryptography;
using System.Text;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Collections.Generic;
using System.Linq;

#<INSERT>

class BookFilterTest {
    public static int Main(string[] args) {
        var testCases = new List<Tuple<List<string>, string, List<string>>> {
            Tuple.Create(new List<string>{"Superman", "Batman", "Spiderman", "Ironman", "Thor"}, "man", new List<string>{"Superman", "Batman", "Spiderman", "Ironman"}),
            Tuple.Create(new List<string>{"Harry Potter", "Lord of the Rings", "Narnia", "Hobbit"}, "Rings", new List<string>{"Lord of the Rings"}),
            Tuple.Create(new List<string>{"Alice in Wonderland", "Peter Pan", "The Cat in the Hat"}, "Hat", new List<string>{"The Cat in the Hat"}),
            Tuple.Create(new List<string>{"The Great Gatsby", "Moby Dick", "War and Peace"}, "Peace", new List<string>{"War and Peace"})
        };

        foreach (var testCase in testCases) {
            var result = BookFilter.SelectBySuffix(testCase.Item1, testCase.Item2);
            if (!result.SequenceEqual(testCase.Item3)) {
                Console.WriteLine($"Test Failed: Input: {string.Join(", ", testCase.Item1)} Suffix: {testCase.Item2} Expected: {string.Join(", ", testCase.Item3)} Got: {string.Join(", ", result)}");
                return -1;
            }
        }

        Console.WriteLine("All tests passed.");
        return 0;
    }
}

using System.Security.Cryptography;
using System.Text;
using System.Diagnostics;
using System.Numerics;
using System;
using System.Collections.Generic;
using System.Linq;
class BookFilter {
    public static List<string> SelectBySuffix(List<string> titles, string suffix) {
        return titles.Where(title => title.EndsWith(suffix)).ToList();
    }
    public static void Check() {
        var testTitles = new List<string>{"Superman", "Batman", "Spiderman", "Ironman", "Thor"};
        var expectedTitles = new List<string>{"Superman", "Batman", "Spiderman", "Ironman"};
        var result = SelectBySuffix(testTitles, "man");
        Console.WriteLine($"Test Passed: {expectedTitles.SequenceEqual(result)}");
    }
}
class Program {

}

Imagine you're working on a project where you need to organize a collection of book titles. Your task is to write a method that selects only the titles that end with a specific suffix. For example, if you're interested in all books that have their titles ending with "man", your method should be able to filter those out from a list of book titles.

Write a C# method that takes two parameters: a list of strings representing book titles and a string representing the suffix you're interested in. The method should return a new list containing only the titles that end with the specified suffix.

Please use C# to implement the complete code without the Main function. Please follow the following type definitions:

```csharp
using xxx
...
class BookFilter
{
    public static List<string> SelectBySuffix(List<string> titles, string suffix) {
    {
        // Implement your code here.
    }
}
```