Beispiel #1
0
        public void ConstructWithNullLogger(ScenarioRouteWalker routeWalker, ILogger logger, MigrationContext context, Exception e)
        {
            "Given an route walker"
            .x(() => routeWalker.Should().BeNull());

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

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

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

            "Then the constructor should throw an exception"
            .x(() => e.Should().NotBeNull().And.Subject.Should().BeOfType <ArgumentNullException>().Which.ParamName.Should().Be("logger"));
        }
Beispiel #2
0
        public void ConstructWithSuccess(ScenarioRouteWalker routeWalker, ILogger logger, MigrationContext context, Exception e)
        {
            "Given a route walker"
            .x(() => routeWalker.Should().BeNull());

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

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

            "When constructing"
            .x(() => e = Record.Exception(() => new ScenarioRouteWalker(context, logger)));

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