Exemple #1
0
 public void GetBasicAuth_returns_null_if_no_auth_header()
 {
     var e = new Environment() { Headers = new Dictionary<string, string>() };
     Assert.That(e.GetBasicAuth(), Is.Null);
 }
Exemple #2
0
 public void GetBasicAuth_return_null_if_auth_header_value_isnt_Basic()
 {
     var e = new Environment() { Headers = new Dictionary<string, string>()
         { { "authorization", "Foo" } } };
     Assert.That(e.GetBasicAuth(), Is.Null);
 }
Exemple #3
0
 public void GetBasicAuth_decodes_basic_auth()
 {
     var e = new Environment() { Headers = new Dictionary<string, string>()
         { { "authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" } } };
     Assert.That(e.GetBasicAuth(), Is.EqualTo("Aladdin:open sesame"));
 }