ripe-russia-4239
11/10/2022, 10:23 AMListNamespaceKeys
Function, like so:
public Output<string> CreateConnectionString(string applicationName, params Union<string, AccessRights>[] accessRights)
{
var authorisationRule = new NamespaceAuthorizationRule(applicationName, new NamespaceAuthorizationRuleArgs
{
AuthorizationRuleName = applicationName,
Rights = accessRights,
NamespaceName = _eventHubNamespace.Name,
ResourceGroupName = ResourceGroupName
}, CustomResourceOptions);
return ListNamespaceKeys.Invoke(new ListNamespaceKeysInvokeArgs
{
AuthorizationRuleName = authorisationRule.Name,
NamespaceName = _eventHubNamespace.Name,
ResourceGroupName = ResourceGroupName
}, _invokeOptions).Apply(o => Output.CreateSecret(o.PrimaryConnectionString));
}
The Functions pass through IMocks.CallAsync()
, but the ListNamespaceKeysResult
type is sealed and the constructor private, and neither anonymous types nor a copy of the Result
type can be serialised by Pulumi. I feel like I'm missing something here, and the documentation isn't filling in the gap 😕
(For the purposes of the tests, I don't much care about the precise value of the PrimaryConnectionString
property--i.e., whether or not it's a valid connection string--and certainly don't care about the values of any of the other properties.)IMocks.CallAsync()
should be an ImmutableDictionary<string, object>
. I've found another one, though 😁
Given the above code sample, what are the names of the Output(s) I need to populate in order for ListNamespaceKeys.Invoke().Apply()
to return the stubbed PrimaryConnectionString
value? How do I go about finding this out, even?