상속: Dev2.Diagnostics.DebugItem
예제 #1
0
        public void DebugItem_TruncateItemResultIfNeeded_With_ValueEqualToMaxCharDispatchCount_Expected_DoesNotInvokeSaveFile()
        {
            var item = CreateDebugItemWithLongValue();

            item.Value = item.Value.Substring(0, DebugItem.MaxCharDispatchCount);

            var debugState = new DebugItemMock();

            debugState.TruncateItemResultIfNeeded(item);

            Assert.AreEqual(0, debugState.SaveFileHitCount);
        }
예제 #2
0
        public void DebugItem_TruncateItemResultIfNeeded_With_ValueEqualToMaxCharDispatchCount_Expected_DoesNotTruncateValueToActCharDispatchCount()
        {
            var item = CreateDebugItemWithLongValue();

            item.Value = item.Value.Substring(0, DebugItem.MaxCharDispatchCount);

            var debugItem = new DebugItemMock();

            debugItem.TruncateItemResultIfNeeded(item);

            Assert.AreEqual(DebugItem.MaxCharDispatchCount, item.Value.Length);
        }
예제 #3
0
        // ReSharper disable InconsistentNaming - Unit Test
        public void TryCache_With_ValueEqualToMaxCharDispatchCount_Expected_DoesNotInvokeSaveFile()
        // ReSharper restore InconsistentNaming
        {
            var item = CreateDebugItemWithLongValue();

            item.Value = item.Value.Substring(0, DebugItem.MaxCharDispatchCount);

            var debugState = new DebugItemMock();

            debugState.TryCache(item);

            Assert.AreEqual(0, debugState.SaveFileHitCount);
        }
예제 #4
0
        // ReSharper disable InconsistentNaming - Unit Test
        public void TryCache_With_ValueEqualToMaxCharDispatchCount_Expected_DoesNotTruncateValueToActCharDispatchCount()
        // ReSharper restore InconsistentNaming
        {
            var item = CreateDebugItemWithLongValue();

            item.Value = item.Value.Substring(0, DebugItem.MaxCharDispatchCount);

            var debugItem = new DebugItemMock();

            debugItem.TryCache(item);

            Assert.AreEqual(DebugItem.MaxCharDispatchCount, item.Value.Length);
        }
예제 #5
0
        public void DebugItem_TruncateItemResultIfNeeded_With_ValueLessThanMaxCharDispatchCount_Expected_DoesNotTruncateValueToActCharDispatchCount()
        {
            const int ExpectedLength = 100;
            var       item           = CreateDebugItemWithLongValue();

            item.Value = item.Value.Substring(0, ExpectedLength);

            var debugState = new DebugItemMock();

            debugState.TruncateItemResultIfNeeded(item);

            Assert.AreEqual(ExpectedLength, item.Value.Length);
        }
예제 #6
0
        public void DebugItem_TruncateItemResultIfNeeded_With_ValueGreaterThanMaxCharDispatchCount_Expected_InvokesSaveFileWithFullContent()
        {
            var item = CreateDebugItemWithLongValue();

            var expectedContents = item.Value;

            var debugItem = new DebugItemMock();

            debugItem.TruncateItemResultIfNeeded(item);

            Assert.AreEqual(1, debugItem.SaveFileHitCount);
            Assert.AreEqual(expectedContents, debugItem.SaveFileContents);
        }
예제 #7
0
        // ReSharper disable InconsistentNaming - Unit Test
        public void TryCache_With_ValueLessThanMaxCharDispatchCount_Expected_DoesNotTruncateValueToActCharDispatchCount()
        // ReSharper restore InconsistentNaming
        {
            const int ExpectedLength = 100;
            var       item           = CreateDebugItemWithLongValue();

            item.Value = item.Value.Substring(0, ExpectedLength);

            var debugState = new DebugItemMock();

            debugState.TryCache(item);

            Assert.AreEqual(ExpectedLength, item.Value.Length);
        }
예제 #8
0
        // ReSharper disable InconsistentNaming - Unit Test
        public void TryCache_With_ValueGreaterThanMaxCharDispatchCount_Expected_InvokesSaveFileWithFullContent()
        // ReSharper restore InconsistentNaming
        {
            var item = CreateDebugItemWithLongValue();

            var expectedContents = item.Value;

            var debugItem = new DebugItemMock();

            debugItem.TryCache(item);

            Assert.AreEqual(1, debugItem.SaveFileHitCount);
            Assert.AreEqual(expectedContents, debugItem.SaveFileContents);
        }
예제 #9
0
        public void TryCache_With_ValueLessThanMaxCharDispatchCount_Expected_DoesNotInvokeSaveFile()

        {
            const int ExpectedLength = 100;
            var       item           = CreateDebugItemWithLongValue();

            item.Value = item.Value.Substring(0, ExpectedLength);

            var debugState = new DebugItemMock();

            debugState.TryCache(item);

            Assert.AreEqual(0, debugState.SaveFileHitCount);
        }
예제 #10
0
        // ReSharper disable InconsistentNaming - Unit Test
        public void TryCache_With_ValueLessThanMaxCharDispatchCount_Expected_DoesNotInvokeSaveFile()
        // ReSharper restore InconsistentNaming
        {
            const int ExpectedLength = 100;
            var item = CreateDebugItemWithLongValue();
            item.Value = item.Value.Substring(0, ExpectedLength);

            var debugState = new DebugItemMock();
            debugState.TryCache(item);

            Assert.AreEqual(0, debugState.SaveFileHitCount);
        }
예제 #11
0
        // ReSharper disable InconsistentNaming - Unit Test
        public void TryCache_With_ValueEqualToMaxCharDispatchCount_Expected_DoesNotTruncateValueToActCharDispatchCount()
        // ReSharper restore InconsistentNaming
        {
            var item = CreateDebugItemWithLongValue();
            item.Value = item.Value.Substring(0, DebugItem.MaxCharDispatchCount);

            var debugItem = new DebugItemMock();
            debugItem.TryCache(item);

            Assert.AreEqual(DebugItem.MaxCharDispatchCount, item.Value.Length);
        }
예제 #12
0
        // ReSharper disable InconsistentNaming - Unit Test
        public void TryCache_With_ValueGreaterThanMaxCharDispatchCount_Expected_InvokesSaveFileWithFullContent()
        // ReSharper restore InconsistentNaming
        {
            var item = CreateDebugItemWithLongValue();

            var expectedContents = item.Value;

            var debugItem = new DebugItemMock();
            debugItem.TryCache(item);

            Assert.AreEqual(1, debugItem.SaveFileHitCount);
            Assert.AreEqual(expectedContents, debugItem.SaveFileContents);
        }