示例#1
0
        public void given_routes_file_exists_when_getting_routes_should_return_routes()
        {
            var logger       = Substitute.For <ILogger>();
            var fileProvider = new FileProvider();
            var provider     = new FileRouteProvider(logger, fileProvider);

            var routes = provider.GetRoutes();

            routes.Count.Should().Be(4);
        }
        public void SetUp()
        {
            var customFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "hidden");

            _logger = Substitute.For <ILogger>();
            var fileProvider = Substitute.For <IFileProvider>();
            var provider     = new FileRouteProvider(_logger, fileProvider, customFilePath);

            fileProvider.Exists(Path.Combine(customFilePath, "routes.json")).Returns(false);
            _routes = provider.GetRoutes();
        }
示例#3
0
        public void given_routes_file_exists_and_custom_file_path_when_getting_routes_should_return_routes()
        {
            var customFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "CustomFilePath");
            var logger         = Substitute.For <ILogger>();
            var fileProvider   = new FileProvider();
            var provider       = new FileRouteProvider(logger, fileProvider, customFilePath);

            var routes = provider.GetRoutes();

            routes.Count.Should().Be(1);
        }