public void TestWebProvoder_Authentication_Exception() { var url = "https://raven.deepcovelabs.com/realtime/hello"; var rpSignature = new SignatureProvider("all good men die young"); var helloData = new NameValueCollection() { {"RAPIVersion","2"}, {"UserName","ernest"}, {"RequestId",Guid.NewGuid().ToString("N")}, {"Timestamp",TimestampProvider.GetFormattedTimestamp()}, {"Signature",rpSignature.GetSignature("ernest")+"0"} }; var ex = Assert.Throws<RavenException>(() => new WebClientProvider().Send(url, helloData)); Assert.That(ex.Message, Contains.Substring("Authentication Failed")); }
public void TestWebProvider_Hello_ToRaven() { var url = "https://raven.deepcovelabs.com/realtime/hello"; var rpSignature = new SignatureProvider("all good men die young"); var helloData = new NameValueCollection() { {"RAPIVersion","2"}, {"UserName","ernest"}, {"RequestId",Guid.NewGuid().ToString("N")}, {"Timestamp",TimestampProvider.GetFormattedTimestamp()}, {"Signature",rpSignature.GetSignature("ernest")} }; var results = new WebClientProvider().Send(url, helloData); Assert.IsNotNull(results); Assert.IsNotNull(results["Signature"]); }