---
schema_version: "1"
id: a0ab1dafec1d00ed45528df0a343c14f4284a36c53b82d8fb6d99acac237a7a7
title: Test Methods
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_canvas_Test_methods.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_canvas_Test_methods.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 48143af27696b78b996d2f320fdbc1926a6f9c11e02a89dbb983a59a94e04181
description: The Test class provides methods for creating test contexts and invoking your CanvasLifecycleHandler with mock data.
---
# Test Methods

The Test class provides methods for creating test contexts and invoking your CanvasLifecycleHandler with mock data.

The following are methods for Test. All are static methods.

- **[mockRenderContext(applicationContextTestValues, environmentContextTestValues)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_canvas_Test_mockRenderContext.htm)**  
    Creates and returns a test Canvas.RenderContext based on the provided application and environment context parameters.
- **[testCanvasLifecycle(lifecycleHandler, mockRenderContext)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_canvas_Test_testCanvasLifecycle.htm)**  
    Calls the Canvas test framework to invoke a CanvasLifecycleHandler with the provided RenderContext.