Ratcow.ObjectDumper.Tests/SimpleTests.cs
/// <summary>
/// Tests to verify that bytes are dumped
/// </summary>
Tests to verify that bytes are dumped
Tests to verify that bytes are dumped
[TestMethod]
        public void DumpBytesTest()
        {
            var dumpedValue = default(string);
            var hexValue = "010507090A0B0C";
            var expectedResult = $"DumpBytesTest -> {hexValue}";
            var dumpValue = new byte[] { 0x01, 0x05, 0x07, 0x09, 0x0A, 0x0B, 0x0C};
            void dumpFunction(object o)
            {
                dumpedValue = o.ToString();
            }
            ObjectDumperHelper.AddOutputHandler(dumpFunction);
            dumpValue.DumpBytes();
            ObjectDumperHelper.RemoveOutputHandler(dumpFunction);
            Assert.IsNotNull(dumpedValue);
            Assert.AreEqual(expectedResult, dumpedValue);
        }
[ TestMethod ] public void DumpBytesTest ( ) { var dumpedValue = default ( string ) ; var hexValue = " " ; var expectedResult = $" DumpBytesTest ->  { hexValue } " ; var dumpValue = new byte [ ] { 0x01 , 0x05 , 0x07 , 0x09 , 0x0A , 0x0B , 0x0C } ; void dumpFunction ( object o ) { dumpedValue = o . ToString ( ) ; } ObjectDumperHelper . AddOutputHandler ( dumpFunction ) ; dumpValue . DumpBytes ( ) ; ObjectDumperHelper . RemoveOutputHandler ( dumpFunction ) ; Assert . IsNotNull ( dumpedValue ) ; Assert . AreEqual ( expectedResult , dumpedValue ) ; }
Tests to verify that bytes are dumped
Tests to verify that bytes are dumped