{
ICloudClient client = new CloudFilesClient { UsePithos = usePithos };
client.Authenticate(_userName, _apiKey);
+ client.CreateContainer("PITHOS");
IList<ContainerInfo> containers=client.ListContainers();
Assert.IsTrue(containers.Count()>1);
{
ICloudClient client = new CloudFilesClient { UsePithos = usePithos };
client.Authenticate(_userName, _apiKey);
+ client.CreateContainer("PITHOS");
+ var info = new FileInfo("devguide.pdf");
+ client.PutObject("PITHOS","devguide.pdf","devguide.pdf",info.Length);
IList<ObjectInfo> objects=client.ListObjects("PITHOS");
Assert.IsTrue(objects.Count()>=1);
ICloudClient client = new CloudFilesClient { UsePithos = usePithos };
client.Authenticate(_userName, _apiKey);
+ client.CreateContainer("PITHOS");
+ client.CreateContainer("DotNetZone");
+
var dnzInfo =client.GetContainerInfo("DotNetZone");
- Assert.AreNotEqual(ContainerInfo.Empty, dnzInfo);
+ Assert.AreNotEqual(ContainerInfo.Empty, dnzInfo,"Expected DotNetZone container not found");
var pithosInfo = client.GetContainerInfo("PITHOS");
- Assert.AreNotEqual(ContainerInfo.Empty, pithosInfo);
+ Assert.AreNotEqual(ContainerInfo.Empty, pithosInfo,"Expected PITHOS container not found");
var mooInfo = client.GetContainerInfo("moo");
Assert.AreEqual(ContainerInfo.Empty, mooInfo);
{
ICloudClient client = new CloudFilesClient { UsePithos = usePithos };
client.Authenticate(_userName, _apiKey);
+ //Prepare test file
+ client.CreateContainer("Shares");
+ string testFileName = "test.txt";
+ var info = new FileInfo(testFileName);
+ client.PutObject("Shares",testFileName,testFileName,info.Length);
+
- client.CreateContainer("Shares");
- Assert.IsTrue(client.ContainerExists("Shares"));
- using (var stream = client.GetObject("DotNetZone", "OData and WCF Data Services.pptx"))
- using(var file=File.Create(@"test.pptx",4096,FileOptions.DeleteOnClose))
+ string downloadFile = "test2.txt";
+ using (var stream = client.GetObject("Shares", testFileName))
+ using (var file = File.Create(downloadFile, 4096, FileOptions.DeleteOnClose))
{
stream.CopyTo(file);
- Assert.IsTrue(File.Exists(@"test.pptx"));
+ Assert.IsTrue(File.Exists(downloadFile));
}
});