Example #1
0
 public Admin(EndpointDb endpointDb, HttpListener listener)
 {
     _endpointDb  = endpointDb;
     _listener    = listener;
     _pingmethods = new Dictionary <string, Action <HttpListenerContext> >
     {
         {
             "GET",
             GoPing
         },
         {
             "HEAD",
             GoPing
         }
     };
     _statusmethods = new Dictionary <string, Action <HttpListenerContext> >
     {
         {
             "GET",
             GoStatus
         },
         {
             "HEAD",
             GoStatus
         }
     };
     _idmethods = new Dictionary <string, Action <HttpListenerContext> >
     {
         { "GET", GoGet },
         { "HEAD", GoGet },
         { "PUT", GoPut },
         { "DELETE", GoDelete }
     };
     _rootmethods = new Dictionary <string, Action <HttpListenerContext> >
     {
         { "GET", GoGetAll },
         { "HEAD", GoGetAll },
         { "POST", GoPost },
         { "DELETE", GoDeleteAll }
     };
 }
Example #2
0
 public void BeforeEach()
 {
     Out.Mute    = true;
     _endpointDb = new EndpointDb();
 }
Example #3
0
 public Stubs(EndpointDb endpointDb, HttpListener listener)
 {
     _endpointDb = endpointDb;
     _listener   = listener;
 }
Example #4
0
 public Stubs(EndpointDb endpointDb) : this(endpointDb, new HttpListener())
 {
 }
Example #5
0
 public Admin(EndpointDb endpointDb) : this(endpointDb, new HttpListener())
 {
 }