Ratcow.ObjectDumper.Tests/SimpleTests.cs
/// <summary>
/// Test to check we can dump the raw value
/// </summary>
Test to check we can dump the raw value
Test to check we can dump the raw value
[TestMethod]
        public void BasicRawTest()
        {
            var dumpedValue = default(string);
            var dumpValue = "A basic test";
            var expectedResult = $"BasicRawTest ->";
            var invocations = 0;
            void dumpFunction(object o)
            {
                dumpedValue = o.ToString();
                Assert.IsNotNull(dumpedValue);
                Assert.AreEqual(invocations++ == 0 ? expectedResult: dumpValue, dumpedValue);
            }
            ObjectDumperHelper.AddOutputHandler(dumpFunction);
            ObjectDumperHelper.UseRawValue = true;
            ObjectDumperHelper.RemoveOutputHandler(dumpFunction);
            ObjectDumperHelper.UseRawValue = false;
            dumpValue.DumpObject();            
        }
[ TestMethod ] public void BasicRawTest ( ) { var dumpedValue = default ( string ) ; var dumpValue = " " ; var expectedResult = $" BasicRawTest -> " ; var invocations = 0 ; void dumpFunction ( object o ) { dumpedValue = o . ToString ( ) ; Assert . IsNotNull ( dumpedValue ) ; Assert . AreEqual ( invocations ++ == 0 ? expectedResult : dumpValue , dumpedValue ) ; } ObjectDumperHelper . AddOutputHandler ( dumpFunction ) ; ObjectDumperHelper . UseRawValue = true ; ObjectDumperHelper . RemoveOutputHandler ( dumpFunction ) ; ObjectDumperHelper . UseRawValue = false ; dumpValue . DumpObject ( ) ; }
Test to check we can dump the raw value
Test to check we can dump the raw value