private async void PhotoListSelection(object sender, RoutedEventArgs e) { var path = ((sender as ListBox)?.SelectedItem.ToString()); BitmapSource img = BitmapFrame.Create(new Uri(path)); CurrentPhoto.Source = img; ClearUndoStack(); if (_cropSelector != null) { #if VISUALCHILD if (Visibility.Visible == CropSelector.Rubberband.Visibility) { CropSelector.Rubberband.Visibility = Visibility.Hidden; } #endif #if NoVISUALCHILD if (CropSelector.ShowRect) { CropSelector.ShowRect = false; } #endif } CropButton.IsEnabled = false; var descriptionService = new ImageDescriptionService(); var imageDescription = await descriptionService.GetDescriptionForImageAsync(path); Tags.Content = "Description:" + imageDescription.Description + "\n\r" + "Tags:" + string.Join(",", imageDescription.Tags.ToArray()); }
public async Task GetDescriptionForImage_ShouldReturn_ExpectedTags(string path, string[] expectedTags) { var sut = new ImageDescriptionService(); var imageDescription = await sut.GetDescriptionForImageAsync(path); imageDescription.Tags.Should().Contain(expectedTags); }