public void FindChannelMissingResourceWithSuccess(AzureIntegrationServicesModel model, string templateKey, TargetResourceTemplate resource, Exception e) { "Given a model" .x(() => model = _model); "And a template key for a resource that doesn't exist" .x(() => templateKey = "missingChannel"); "When finding the resource template" .x(() => e = Record.Exception(() => resource = CustomLiquidFunctions.FindResourceTemplate(model, templateKey))); "Then the find should succeed" .x(() => e.Should().BeNull()); "And the target resource should be null" .x(() => resource.Should().BeNull()); }
public void FindChannelResourceWithTemplateKeyNullError(AzureIntegrationServicesModel model, string templateKey, TargetResourceTemplate resource, Exception e) { "Given a model" .x(() => model = _model); "And a null template key" .x(() => templateKey.Should().BeNull()); "When finding the resource template" .x(() => e = Record.Exception(() => resource = CustomLiquidFunctions.FindResourceTemplate(model, templateKey))); "Then the find should succeed" .x(() => e.Should().BeNull()); "And the target resource should be null" .x(() => resource.Should().BeNull()); }
public void FindChannelResourceWithSuccess(AzureIntegrationServicesModel model, string templateKey, TargetResourceTemplate resource, Exception e) { "Given a model" .x(() => model = _model); "And a template key" .x(() => templateKey = "topicChannelAzureServiceBusStandard"); "When finding the resource template" .x(() => e = Record.Exception(() => resource = CustomLiquidFunctions.FindResourceTemplate(model, templateKey))); "Then the find should succeed" .x(() => e.Should().BeNull()); "And the target resource should be the expected value from the model" .x(() => { resource.Should().NotBeNull(); resource.TemplateKey.Should().Be("topicChannelAzureServiceBusStandard"); }); }