CustomerContextModule

PackageAcme.Docs

CustomerContext

CustomerContext demonstrates deterministic setup for an XML documentation example. It keeps a small amount of sample state so the effect of scenario preparation is visible.

loadPreferredCustomer carries DocScenarioAttribute and sets the discount fixture. The XML example on price names that scenario, so FsLiveDocs runs setup before evaluating the transcript.

Production scenarios should follow the same shape but keep setup fast, deterministic, and local.

Summary

NameSignatureSynopsis
Operations
loadPreferredCustomerloadPreferredCustomer ()Loads the deterministic preferred-customer fixture.
priceprice subtotalApplies the currently loaded customer's discount.

Operations

kind:member

loadPreferredCustomer

loadPreferredCustomer ()
Member
Loads the deterministic preferred-customer fixture.

Parameters

NameTypeDescription
()unit

Returns

unit
kind:member

price

price subtotal
Member
Applies the currently loaded customer's discount.

Parameters

NameTypeDescription
subtotaldecimal

Returns

decimal

Verification Examples

PreferredCustomerPrice

> Acme.Docs.CustomerContext.price 100M;;
val it: decimal = 90.0M