Given a specific coding problem, write a function in C# or Java to solve it, and then write the corresponding unit tests using xUnit or nUnit.