CppUnit - The Unit Testing Library. Here is a short cookbook to help you get started.
Simple Test Case You want to know whether your code is working. How do you do it? There are many ways. Kinect for Windows. Learn Visual C# on MSDN. C# Tutorial #1: The Basics.