public void ConstructWithNullFileRepository(SC002PropertySchemaGenerator generator, IFileRepository fileRepository, ILogger logger, IApplicationModel model, MigrationContext context, Exception e) { "Given an generator" .x(() => generator.Should().BeNull()); "And a null file repository" .x(() => fileRepository.Should().BeNull()); "And a model" .x(() => model = new AzureIntegrationServicesModel()); "And a context" .x(() => context = TestHelper.BuildContext()); "And a logger" .x(() => logger = _mockLogger.Object); "When constructing with a null file repository" .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("fileRepository")); }
public void ConstructWithSuccess(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 a model" .x(() => model = new AzureIntegrationServicesModel()); "And a context" .x(() => context = TestHelper.BuildContext()); "And a logger" .x(() => logger = _mockLogger.Object); "When constructing" .x(() => e = Record.Exception(() => new SC002PropertySchemaGenerator(fileRepository, model, context, logger))); "Then the constructor should NOT throw an exception" .x(() => e.Should().BeNull()); }