public void ConstructWithNullModel(IBizTalkParser parser, ILogger logger, IApplicationModel model, MigrationContext context, Exception e) { "Given a parser" .x(() => parser.Should().BeNull()); "And a logger" .x(() => logger = _mockLogger.Object); "And null model" .x(() => model.Should().BeNull()); "And a context" .x(() => context = new MigrationContext()); "When constructing with null model" .x(() => e = Record.Exception(() => new DistributionListParser(model, context, logger))); "Then the parser constructor should throw an exception" .x(() => e.Should().NotBeNull().And.Subject.Should().BeOfType <ArgumentNullException>().Which.ParamName.Should().Be("model")); }
public void ConstructWithNullLogger(IBizTalkParser parser, ILogger logger, IApplicationModel model, MigrationContext context, Exception e) { "Given a parser" .x(() => parser.Should().BeNull()); "And null logger" .x(() => logger.Should().BeNull()); "And a model" .x(() => model = new AzureIntegrationServicesModel()); "And a context" .x(() => context = new MigrationContext()); "When constructing with null logger" .x(() => e = Record.Exception(() => new OrchestrationServiceDeclarationParser(model, context, logger))); "Then the parser constructor should throw an exception" .x(() => e.Should().NotBeNull().And.Subject.Should().BeOfType <ArgumentNullException>().Which.ParamName.Should().Be("logger")); }
public void ConstructWithNullContext(IBizTalkParser parser, ILogger logger, IApplicationModel model, MigrationContext context, Exception e) { "Given a parser" .x(() => parser.Should().BeNull()); "And a logger" .x(() => logger = _mockLogger.Object); "And a model" .x(() => model = new AzureIntegrationServicesModel()); "And a null context" .x(() => context.Should().BeNull()); "When constructing with null context" .x(() => e = Record.Exception(() => new SendPortPipelineDataParser(model, context, logger))); "Then the parser constructor should throw an exception" .x(() => e.Should().NotBeNull().And.Subject.Should().BeOfType <ArgumentNullException>().Which.ParamName.Should().Be("context")); }
public void ConstructWithSuccess(IBizTalkParser parser, ILogger logger, IApplicationModel model, MigrationContext context, Exception e) { "Given a parser" .x(() => parser.Should().BeNull()); "And a logger" .x(() => logger = _mockLogger.Object); "And a model" .x(() => model = new AzureIntegrationServicesModel()); "And a context" .x(() => context = new MigrationContext()); "When constructing" .x(() => e = Record.Exception(() => parser = new DistributionListParser(model, context, logger))); "Then the parser constructor should succeed" .x(() => { e.Should().BeNull(); parser.Should().NotBeNull(); }); }