Beispiel #1
0
        private async Task SaveAsync()
        {
            if (FullBlob == null || Storage == null)
            {
                return;
            }

            Blob b = FullBlob;

            b.Metadata.Clear();
            b.Metadata.AddRange(EditableKeyValue.ToDictionary(EditableMetadata));
            IsLoading = true;
            try
            {
                await Storage.SetBlobAsync(b);
            }
            catch (Exception ex)
            {
                await DialogService.ShowMessageAsync("Failed to update", ex.Message);
            }
            finally
            {
                IsLoading = false;
                await LoadFullBlobAsync();
            }
        }
Beispiel #2
0
        public void DefaultKeyAndValueAreNull()
        {
            EditableKeyValue keyValue = new EditableKeyValue();

            Assert.IsNull(keyValue.Key);
            Assert.IsNull(keyValue.Value);
        }
Beispiel #3
0
        public void DisplayTextContainsKeyAndValue()
        {
            string someKey   = "someKey";
            string someValue = "someValue";

            EditableKeyValue keyValue    = new EditableKeyValue(someKey, someValue);
            string           displayText = keyValue.ToString();

            Assert.IsFalse(-1 == displayText.IndexOf(someKey));
            Assert.IsFalse(-1 == displayText.IndexOf(someValue));
        }