Hi Sir, Hope you are doing well!
I need some help in MS-Unit testing in C# .net program, I watched all of your youtube videos but…
So, below is my question, Please help!
Write Automated MS-Unit Test in C#.NET for the following C#.NET program. The program converts a decimal value into binary?
using System;
namespace BinaryClass
{
class Program
{
static void Main(string[] args)
{
Program p = new Program();
Console.WriteLine("Binary Value of 4 = "+p.IntToBinaryString(4));
}
public string IntToBinaryString(int number)
{
const int mask = 1;
var binary = string.Empty;
while (number > 0)
{
binary = (number & mask) + binary;
number = number >> 1;
}
return binary;
}
}
}