public void Should_get_request_by_path_and_method(string path, string method) { var repository = RequestFakeRepository.Load("./db-test.json"); var request = repository.GetRequestFake(path, method); request.Should().NotBeNull(); request.Method.ToLower().Should().Be(method.ToLower()); }
public DefaultController(RequestFakeRepository repository) { _repository = repository ?? throw new ArgumentNullException(nameof(repository)); }
public void Should_load_json() { var repository = RequestFakeRepository.Load("./db-test.json"); repository.Should().NotBeNull(); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); services.AddSingleton(RequestFakeRepository.Load(Environment.GetEnvironmentVariable("DATABASE_PATH") ?? Configuration.GetValue <string>("DatabasePath"))); }