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(String, ImmutableDictionary<String, Object>, String)

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

Declaration
Task<object> CallAsync(string token, ImmutableDictionary<string, object> args, string provider)
Parameters
Type Name Description
System.String token

Function token.

System.Collections.Immutable.ImmutableDictionary<System.String, System.Object> args

Dictionary of input arguments.

System.String provider

Provider.

Returns
Type Description
System.Threading.Tasks.Task<System.Object>

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

View Source

NewResourceAsync(String, String, ImmutableDictionary<String, Object>, String, String)

Invoked when a new resource is created by the program.

Declaration
Task<(string id, object state)> NewResourceAsync(string type, string name, ImmutableDictionary<string, object> inputs, string provider, string id)
Parameters
Type Name Description
System.String type

Resource type name.

System.String name

Resource name.

System.Collections.Immutable.ImmutableDictionary<System.String, System.Object> inputs

Dictionary of resource input properties.

System.String provider

Provider.

System.String id

Resource identifier.

Returns
Type Description
System.Threading.Tasks.Task<System.ValueTuple<System.String, System.Object>>

A tuple of a resource identifier and resource state. State can be either a POCO or a dictionary bag.

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