Cosmos/Tests/Cosmos.System.Tests/Utilities.cs
José Pedro 91a9ffc7ff
Fixed unit tests and added them to Test.sln.
Removed compiler unit tests.
2018-08-04 21:30:50 +01:00

32 lines
775 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Cosmos.System.Tests
{
public static class Utilities
{
public static string PrettyPrint(byte[] data)
{
if (data == null)
{
throw new ArgumentNullException("data");
}
var xSB = new StringBuilder();
for (int i = 0; i < data.Length; i++)
{
if (i > 0
&& (i % 8 == 0))
{
xSB.AppendLine();
}
xSB.Append(data[i].ToString("X2"));
xSB.Append(" ");
}
return xSB.ToString().Trim();
}
}
}