AppSurface Search
API Reference

Support

Type

PublicApiSnapshot

Source

Creates deterministic text snapshots of public API declarations for checked-in contract review.

Method

Create

string[] Create(Assembly assembly) Source

Describes every visible type in assembly in ordinal order.

Parameters

  • assemblyAssembly whose public and protected contract is inspected.

Returns

Deterministically ordered declaration lines.

Method

AssertMatches

void AssertMatches(Assembly assembly, string copiedBaselineName, string sourceRelativePath) Source

Asserts the generated snapshot matches its copied baseline, or updates the trusted source baseline.

Parameters

  • assemblyAssembly whose contract is inspected.
  • copiedBaselineNameBaseline copied into the test output directory.
  • sourceRelativePathTrusted repository-relative baseline path used only in explicit update mode.

Exceptions

  • IOExceptionThrown when a baseline cannot be read or written.
  • Xunit.Sdk.EqualExceptionThrown when the reviewed and generated snapshots differ.

Remarks

Set APPSURFACE_UPDATE_PUBLIC_API_BASELINES=1 only for an intentional reviewed API update.

Method

DescribeType

string[] DescribeType(Type type) Source

Describes one visible type declaration and its visible declared members.

Parameters

  • typeType to inspect.

Returns

The type declaration followed by ordinally sorted member declarations.