private static async Task <int> OnDelete(DeleteOptions options)
        {
            Console.WriteLine(
                $"Deleting global storage blob list for scid : {options.ServiceConfigurationId}, sandbox {options.Sandbox}, path {options.Path}, type {options.Type}");

            await TitleStorage.DeleteGlobalStorageBlobAsync(options.ServiceConfigurationId, options.Sandbox,
                                                            options.Path, (TitleStorageBlobType)options.Type);

            Console.WriteLine("Global storage blob deleted");

            return(0);
        }
示例#2
0
        public async Task DeleteBlob()
        {
            this.SetUpMockAuth();
            this.SetupMockBytes();

            var uri = new Uri(new Uri(ClientSettings.Singleton.TitleStorageEndpoint), $"global/scids/{DefaultScid}/data/{DefaultGlobalStoragePath},{DefaultFileType}");

            var mockHttp = new MockHttpMessageHandler();

            mockHttp.Expect(HttpMethod.Delete, uri.ToString())
            .WithHeaders("Authorization", this.ExpectedToken(DefaultScid, DefaultSandbox))
            .Respond("application/json", "{}");

            TestHook.MockHttpHandler = mockHttp;

            TitleStorageBlobType fileType = (TitleStorageBlobType)Enum.Parse(typeof(TitleStorageBlobType), DefaultFileType, true);
            await TitleStorage.DeleteGlobalStorageBlobAsync(DefaultScid, DefaultSandbox, DefaultGlobalStoragePath, fileType);
        }