Exemple #1
0
        public void DumpMessageTest(bool asArrayBuffer, Log.Levels levels)
        {
            Log.level = levels;
            const string Label = "fun label";

            byte[] data = new byte[5] {
                10, 11, 12, 13, 14
            };
            string expected = "0B-0C-0D";

            if (levels >= Log.Levels.verbose)
            {
                LogAssert.Expect(UnityEngine.LogType.Log, $"VERBOSE: <color=blue>{Label}: {expected}</color>");
            }

            if (asArrayBuffer)
            {
                var buffer = new ArrayBuffer(null, 10);
                buffer.CopyFrom(data, 1, 3);
                Log.DumpBuffer(Label, buffer);
            }
            else
            {
                Log.DumpBuffer(Label, data, 1, 3);
            }

            LogAssert.NoUnexpectedReceived();
        }