예제 #1
0
        public void ShouldShowAssetsOfParentFolderWhenUpArrowCommandIsExecuted()
        {
            VideoAsset videoAsset = new VideoAsset {
                Title = "VideoAsset"
            };
            AudioAsset audioAsset = new AudioAsset {
                Title = "AudioAsset"
            };
            FolderAsset folderAsset = new FolderAsset {
                Title = "ParentFolder"
            };

            folderAsset.AddAssets(new ObservableCollection <Asset> {
                videoAsset, audioAsset
            });

            var presentationModel = this.CreatePresentationModel();

            this.assetsAvailableEvent.SubscribeArgumentAction.Invoke(new Infrastructure.DataEventArgs <List <Asset> >(new List <Asset> {
                folderAsset
            }));

            presentationModel.OnAssetSelected(folderAsset);

            Assert.AreEqual(2, presentationModel.Assets.Count);

            presentationModel.UpArrowCommand.Execute(null);

            Assert.AreEqual(1, presentationModel.Assets.Count);
        }
예제 #2
0
        public void ShouldNotChangeCurrentFolderIfParentFolderIsNullAndUpArrowCommandIsExecuted()
        {
            VideoAsset videoAsset = new VideoAsset {
                Title = "VideoAsset"
            };
            FolderAsset folderAsset = new FolderAsset {
                Title = "ParentFolder",
            };

            folderAsset.AddAssets(new ObservableCollection <Asset> {
                videoAsset
            });

            var presentationModel = this.CreatePresentationModel();

            presentationModel.Assets = new List <Asset> {
                folderAsset
            };

            Assert.AreEqual(1, presentationModel.Assets.Count);

            presentationModel.UpArrowCommand.Execute(null);

            Assert.AreEqual(1, presentationModel.Assets.Count);
        }