コード例 #1
0
 public void SetUp()
 {
     deleteStorageItem = new DeleteStorageItem("http://storageurl", "containername", "storageitemname");
     mockrequest = new Mock<ICloudFilesRequest>();
     mockrequest.SetupGet(x => x.Headers).Returns(new WebHeaderCollection());
     deleteStorageItem.Apply(mockrequest.Object);
 }
コード例 #2
0
        public void when_deleting_a_storage_item()
        {
            var deleteStorageItem = new DeleteStorageItem("http://storageurl", "containername", "storageitemname");
            var _mockrequest = new Mock<ICloudFilesRequest>();
             _mockrequest.SetupGet(x => x.Headers).Returns(new WebHeaderCollection());
            deleteStorageItem.Apply(_mockrequest.Object);

            should("start with storageurl, have container name next, and then end with the item being deleted",
                ()=>deleteStorageItem.CreateUri().Is("http://storageurl/containername/storageitemname"));
            should("use HTTP DELETE method",()=> _mockrequest.VerifySet(x => x.Method = "DELETE"));
        }