Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
 public DefaultController(RequestFakeRepository repository)
 {
     _repository = repository ?? throw new ArgumentNullException(nameof(repository));
 }
Ejemplo n.º 3
0
        public void Should_load_json()
        {
            var repository = RequestFakeRepository.Load("./db-test.json");

            repository.Should().NotBeNull();
        }
Ejemplo n.º 4
0
 // 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")));
 }