public void Given_a_url_should_add_media_item_with_name_of_mp3_file() { var eventAgg = new Mock<IEventAggregator>(); var library = new Mock<ILibrary>(); library.Setup(x => x.MediaItems).Returns(new ObservableCollection<MediaItem>()); var libraryWidget = new LibraryWidgetViewModel(eventAgg.Object, library.Object); libraryWidget.NavigateTo("http://someserver/path/to/media.mp3"); library.Verify(l => l.AddNewMediaItem("media", new Uri("http://someserver/path/to/media.mp3"))); }
public void Given_a_local_file_should_add_media_item_with_name_of_mp3_file() { var eventAgg = new Mock<IEventAggregator>(); var library = new Mock<ILibrary>(); library.Setup(x => x.MediaItems).Returns(new ObservableCollection<MediaItem>()); var libraryWidget = new LibraryWidgetViewModel(eventAgg.Object, library.Object); libraryWidget.NavigateTo(@"C:\Users\me\My Music\the media.mp3"); library.Verify(l => l.AddNewMediaItem("the media", new Uri(@"file://C:\Users\me\My Music\the media.mp3"))); }
public void Given_a_local_file_should_add_media_item_with_name_of_mp3_file() { var eventAgg = new Mock <IEventAggregator>(); var library = new Mock <ILibrary>(); library.Setup(x => x.MediaItems).Returns(new ObservableCollection <MediaItem>()); var libraryWidget = new LibraryWidgetViewModel(eventAgg.Object, library.Object); libraryWidget.NavigateTo(@"C:\Users\me\My Music\the media.mp3"); library.Verify(l => l.AddNewMediaItem("the media", new Uri(@"file://C:\Users\me\My Music\the media.mp3"))); }
public void Given_a_url_should_add_media_item_with_name_of_mp3_file() { var eventAgg = new Mock <IEventAggregator>(); var library = new Mock <ILibrary>(); library.Setup(x => x.MediaItems).Returns(new ObservableCollection <MediaItem>()); var libraryWidget = new LibraryWidgetViewModel(eventAgg.Object, library.Object); libraryWidget.NavigateTo("http://someserver/path/to/media.mp3"); library.Verify(l => l.AddNewMediaItem("media", new Uri("http://someserver/path/to/media.mp3"))); }