Ejemplo n.º 1
0
        public Storage_requests()
        {
            MockHttpMessageHandler mockHttp = MockTools.GetNewMockHandler();

            mockHttp.When(HttpMethod.Get, "*/testing/testfile").Respond("application/octet-stream", "Yep, this is the testfile");
            mockHttp.When(HttpMethod.Put, "*/testing/testfile").Respond(HttpStatusCode.Created);
            mockHttp.When(HttpMethod.Delete, "*/testing/testfile").Respond(HttpStatusCode.OK);

            mockHttp.When(HttpMethod.Get, "*/testing/testfolder/").Respond("application/json", JsonConvert.SerializeObject(FolderStorageEntries));


            StorageKey sKey = new StorageKey();

            sKey.SetToken("12345678-1234-1234-123456789012-1234-1234", mockHttp);

            storage = new Storage(sKey, "testing");
        }