Table of Contents

Class Renderer

Namespace
SnapshotAssertions.Render
Assembly
SnapshotAssertions.dll

Static factories for SnapshotRenderer<T> instances. Use For<T>(Func<T, string>) to build a renderer from an inline lambda when a full subclass is unnecessary.

public static class Renderer
Inheritance
Renderer
Inherited Members

Methods

For<T>(Func<T, string>)

Builds a SnapshotRenderer<T> that delegates to the supplied function. Equivalent to a one-line subclass of SnapshotRenderer<T>; use when the renderer is single-use and doesn't need its own type, configuration, or state.

public static SnapshotRenderer<T> For<T>(Func<T, string> renderFn)

Parameters

renderFn Func<T, string>

The rendering function. Must not be null.

Returns

SnapshotRenderer<T>

A renderer that invokes renderFn on each Render(T) call.

Type Parameters

T

The type to render.

Exceptions

ArgumentNullException

renderFn is null.