skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop

    Web

    Kendo UI UI for Angular UI for Vue UI for jQuery KendoReact UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Telerik JustMock

    CMS

    Sitefinity

    AI Productivity Tools

    AI Coding Assistants

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    KendoReact Free VB.NET to C# Converter Testing Framework
    View all products
  • Overview
    • What's New
    • Roadmap
    • Release History
  • Docs & Support
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class DebugView

Provides introspection and tracing capabilities for ease of debugging failing tests.

Inheritance
System.Object
DebugView
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Telerik.JustMock
Assembly: Telerik.JustMock.dll

Syntax

public static class DebugView
Remarks

Often it’s not very clear why a test that uses the mocking API fails. A test may have multiple arrangements, each with various overlapping argument matchers. When you have a complex set of arrangements and the system under test makes a call to a mock, it’s sometimes hard to understand which arrangement actually gets executed and which expectations get updated. The DebugView class can help in such times. It can be used in two ways – to provide an overview of the current internal state of the mocking API, and to provide a step-by-step replay of the interception events happening inside the mocking API.

The current internal state is exposed through the CurrentState property. It contains a human-readable description of the current state of the mocking API. It describes in detail the state of all occurrence expectations and the number of calls to all intercepted methods. The first part is useful when debugging failing expectations from arrangements. The second part is useful for debugging failing occurrence asserts.

The step-by-step replay is intended for use with an interactive debugger (e.g. the Visual Studio managed debugger). To begin using it, add the DebugView class to a Watch in the debugger. Break the test execution before your test begins. Set the IsTraceEnabled property to true from the Watch window. Now, as you step over each line in your test, the FullTrace and LastTrace properties will be updated to show the events happening inside the mocking API. FullTrace will show the entire event log so far. LastTrace will contain all events that have happened since the debugger last updated the Watch window, but only if any new events have actually occurred.

Properties

CurrentState

Shows in human-readable format the current state of the mocking API internals.

Declaration
public static string CurrentState { get; }
Property Value
System.String

FullTrace

Shows the entire event log when the event trace is enabled.

Declaration
public static string FullTrace { get; }
Property Value
System.String

IsTraceEnabled

Enables or disables the step-by-step event trace.

Declaration
public static bool IsTraceEnabled { get; set; }
Property Value
System.Boolean

LastTrace

When the event trace is enabled, this property shows the portion of the event log that was added since the property was last evaluated.

Declaration
public static string LastTrace { get; }
Property Value
System.String

Getting Started
  • Unit Testing and Mocking Explained
  • Videos
  • FAQs
Community
  • Forums
  • Blogs
  • Feedback Portal

Copyright © 2019 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.