Show / Hide Table of Contents

Interface IMocks

Hooks to mock the engine that provide test doubles for offline unit testing of stacks.

Namespace: Pulumi.Testing
Assembly: Pulumi.dll
Syntax
public interface IMocks

Methods

View Source

CallAsync(MockCallArgs)

Invoked when the program needs to call a provider to load data (e.g., to retrieve an existing resource).

Declaration
Task<object> CallAsync(MockCallArgs args)
Parameters
Type Name Description
MockCallArgs args

MockCallArgs

Returns
Type Description
Task<object>

Invocation result, can be either a POCO or a dictionary bag.

View Source

NewResourceAsync(MockResourceArgs)

Invoked when a new resource is created by the program.

Declaration
Task<(string? id, object state)> NewResourceAsync(MockResourceArgs args)
Parameters
Type Name Description
MockResourceArgs args

MockResourceArgs

Returns
Type Description
Task<(string id, object state)>

A tuple of a resource identifier and resource state. State can be either a POCO or a dictionary bag. The returned ID may be null for component resources.

  • View Source
Back to top Copyright 2016-2023, Pulumi Corporation.