root / trunk / Pithos.Network.Test / CloudFilesClientTest.cs @ c53aa229
History | View | Annotate | Download (1014 Bytes)
1 |
using System; |
---|---|
2 |
using System.Collections.Generic; |
3 |
using System.IO; |
4 |
using System.Linq; |
5 |
using System.Text; |
6 |
using NUnit.Framework; |
7 |
|
8 |
namespace Pithos.Network.Test |
9 |
{ |
10 |
[TestFixture] |
11 |
class CloudFilesClientTest |
12 |
{ |
13 |
[Test] |
14 |
public void TestPutHashMap() |
15 |
{ |
16 |
var account = "890329@vho.grnet.gr"; |
17 |
var apiKey = "24989dce4e0fcb072f8cb60c8922be19"; |
18 |
var client = new CloudFilesClient(account, apiKey) |
19 |
{ |
20 |
AuthenticationUrl = @"https://pithos.dev.grnet.gr", |
21 |
UsePithos = true |
22 |
}; |
23 |
client.Authenticate(); |
24 |
var fileName = @"vlc-1.1.11-win32.exe"; |
25 |
var treeHash=Signature.CalculateTreeHashAsync(Path.Combine(@"e:\pithos\" ,fileName), 4*1024*1024 , "sha256").Result; |
26 |
var result = client.PutHashMap(account, "pithos", fileName, treeHash).Result; |
27 |
|
28 |
Assert.AreEqual(0,result.Count); |
29 |
} |
30 |
|
31 |
|
32 |
|
33 |
} |
34 |
} |