Exemplo n.º 1
0
        public void ConstructWithNullModel(ResourceGeneratorAnalyzer analyzer, IConfigurationRepository repository, IResourceGenerator generator, IApplicationModel model, ILogger logger, MigrationContext context, Exception e)
        {
            "Given an analyzer"
            .x(() => analyzer.Should().BeNull());

            "And a repository"
            .x(() => repository = _mockRepository.Object);

            "And a generator"
            .x(() => generator = _mockGenerator.Object);

            "And null model"
            .x(() => model.Should().BeNull());

            "And a context"
            .x(() => context = TestHelper.BuildContext());

            "And a logger"
            .x(() => logger = _mockLogger.Object);

            "When constructing with a null model"
            .x(() => e = Record.Exception(() => new ResourceGeneratorAnalyzer(repository, generator, model, context, logger)));

            "Then the constructor should throw an exception"
            .x(() => e.Should().NotBeNull().And.Subject.Should().BeOfType <ArgumentNullException>().Which.ParamName.Should().Be("model"));
        }
        public void ConstructWithNullModel(AP003ReceiveConfigurationEntryGenerator generator, IFileRepository fileRepository, IScenarioRouteWalker routeWalker, ILogger logger, IApplicationModel model, MigrationContext context, Exception e)
        {
            "Given an generator"
            .x(() => generator.Should().BeNull());

            "And a file repository"
            .x(() => fileRepository = _mockFileRepository.Object);

            "And null model"
            .x(() => model.Should().BeNull());

            "And a context"
            .x(() => context = TestHelper.BuildContext());

            "And a logger"
            .x(() => logger = _mockLogger.Object);

            "And a route walker"
            .x(() => routeWalker = new ScenarioRouteWalker(TestHelper.BuildContext(), _mockLogger.Object));

            "When constructing with a null model"
            .x(() => e = Record.Exception(() => new AP003ReceiveConfigurationEntryGenerator(fileRepository, routeWalker, model, context, logger)));

            "Then the constructor should throw an exception"
            .x(() => e.Should().NotBeNull().And.Subject.Should().BeOfType <ArgumentNullException>().Which.ParamName.Should().Be("model"));
        }
        public void ConstructWithNullModel(TemplateRendererConverter converter, IFileRepository fileRepository, ITemplateRepository repository, ITemplateRenderer renderer, IApplicationModel model, ILogger logger, MigrationContext context, Exception e)
        {
            "Given a converter"
            .x(() => converter.Should().BeNull());

            "And a file repository"
            .x(() => fileRepository = _mockFileRepository.Object);

            "And a repository"
            .x(() => repository = _mockRepository.Object);

            "And a renderer"
            .x(() => renderer = _mockRenderer.Object);

            "And a null model"
            .x(() => model.Should().BeNull());

            "And a context"
            .x(() => context = TestHelper.BuildContext());

            "And a logger"
            .x(() => logger = _mockLogger.Object);

            "When constructing with a null model"
            .x(() => e = Record.Exception(() => new TemplateRendererConverter(fileRepository, repository, renderer, model, context, logger)));

            "Then the constructor should throw an exception"
            .x(() => e.Should().NotBeNull().And.Subject.Should().BeOfType <ArgumentNullException>().Which.ParamName.Should().Be("model"));
        }
        public void ConstructWithNullModel(HtmlReportFormatter reporter, IApplicationModel model, MigrationContext context, IRunState state, IReportWriter writer, ILogger logger, Exception e)
        {
            "Given an reporter"
            .x(() => reporter.Should().BeNull());

            "And a model"
            .x(() => model.Should().BeNull());

            "And run state"
            .x(() => state = TestHelper.BuildRunState(model));

            "And a context"
            .x(() => context = TestHelper.BuildContext());

            "And a writer"
            .x(() => writer = _mockWriter.Object);

            "And a logger"
            .x(() => logger = _mockLogger.Object);

            "When constructing with a null model"
            .x(() => e = Record.Exception(() => new HtmlReportFormatter(model, context, state, writer, logger)));

            "Then the constructor should throw an exception"
            .x(() => e.Should().NotBeNull().And.Subject.Should().BeOfType <ArgumentNullException>().Which.ParamName.Should().Be("model"));
        }
        public void ConstructWithNullEventArgs(ModelStateEventArgs eventArgs, IApplicationModel model, Exception e)
        {
            "Given the event args"
            .x(() => eventArgs.Should().BeNull());

            "And the model state"
            .x(() => model.Should().BeNull());

            "When constructing with null model state"
            .x(() => e = Record.Exception(() => new ModelStateEventArgs(model)));

            "Then the event args constructor should throw an exception"
            .x(() => e.Should().NotBeNull().And.Subject.Should().BeOfType <ArgumentNullException>().Which.ParamName.Should().Be("model"));
        }
        public void ConstructWithNullModel(DP002TransformDependencyAnalyzer analyzer, ILogger logger, IApplicationModel model, MigrationContext context, Exception e)
        {
            "Given an analyzer"
            .x(() => analyzer.Should().BeNull());

            "And null model"
            .x(() => model.Should().BeNull());

            "And a context"
            .x(() => context = TestHelper.BuildContext());

            "And a logger"
            .x(() => logger = _mockLogger.Object);

            "When constructing with a null model"
            .x(() => e = Record.Exception(() => new DP002TransformDependencyAnalyzer(model, context, logger)));

            "Then the constructor should throw an exception"
            .x(() => e.Should().NotBeNull().And.Subject.Should().BeOfType <ArgumentNullException>().Which.ParamName.Should().Be("model"));
        }
        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"));
        }
Exemplo n.º 8
0
        public void ConstructWithNullModel(IRunState state, IRunnerConfiguration config, IApplicationModel model, Exception e)
        {
            "Given the runner state"
            .x(() => state.Should().BeNull());

            "And runner configuration"
            .x(() => config = _mockConfig.Object);

            "And null model state"
            .x(() => model.Should().BeNull());

            "When constructing with null model state"
            .x(() => e = Record.Exception(() => state = new RunState(config, model)));

            "Then the runner state constructor should throw an exception"
            .x(() => e.Should().BeNull());

            "And the config should be available"
            .x(() => state.Configuration.Should().NotBeNull().And.BeSameAs(config));

            "And the model should be null"
            .x(() => state.Model.Should().BeNull());
        }
        public void ConstructWithNullModel(SC002PropertySchemaGenerator generator, IFileRepository fileRepository, ILogger logger, IApplicationModel model, MigrationContext context, Exception e)
        {
            "Given an generator"
            .x(() => generator.Should().BeNull());

            "And a file repository"
            .x(() => fileRepository = _mockFileRepository.Object);

            "And null model"
            .x(() => model.Should().BeNull());

            "And a context"
            .x(() => context = TestHelper.BuildContext());

            "And a logger"
            .x(() => logger = _mockLogger.Object);

            "When constructing with a null model"
            .x(() => e = Record.Exception(() => new SC002PropertySchemaGenerator(fileRepository, model, context, logger)));

            "Then the constructor should throw an exception"
            .x(() => e.Should().NotBeNull().And.Subject.Should().BeOfType <ArgumentNullException>().Which.ParamName.Should().Be("model"));
        }