public void TestMoveObject() { IObjectStorageProvider provider = new CloudFilesProvider(Bootstrapper.Settings.TestIdentity); string containerName = TestContainerPrefix + Path.GetRandomFileName(); string objectName = Path.GetRandomFileName(); string movedName = Path.GetRandomFileName(); // another random name counts as random content string fileData = Path.GetRandomFileName(); ObjectStore containerResult = provider.CreateContainer(containerName); Assert.AreEqual(ObjectStore.ContainerCreated, containerResult); using (MemoryStream uploadStream = new MemoryStream(Encoding.UTF8.GetBytes(fileData))) { provider.CreateObject(containerName, uploadStream, objectName); } string actualData = ReadAllObjectText(provider, containerName, objectName, Encoding.UTF8); Assert.AreEqual(fileData, actualData); provider.MoveObject(containerName, objectName, containerName, movedName); try { using (MemoryStream downloadStream = new MemoryStream()) { provider.GetObject(containerName, objectName, downloadStream); } Assert.Fail("Expected an exception (object should not exist)"); } catch (ResponseException) { } actualData = ReadAllObjectText(provider, containerName, movedName, Encoding.UTF8); Assert.AreEqual(fileData, actualData); /* Cleanup */ provider.DeleteContainer(containerName, deleteObjects: true); }