Exemplo n.º 1
0
        public void Test_Total_Duration_All_NTSC_SD_Video_Clips()
        {
            // Arrange
            var videoReel = new List <VideoReel>
            {
                new VideoReel()
                {
                    VideoDefinition = VideoDefinition.SD,
                    VideoStandard   = VideoStandard.NTSC,
                    Name            = "Video Eight",
                    TotalDuration   = "00:00:54:08",
                    Id         = 1,
                    VideoClips = new List <VideoClip>()
                    {
                        DataHelper.GetaNTSCSDVideoClip(), DataHelper.GetaNTSCSDVideoClipB(), DataHelper.GetaNTSCSDVideoClipC()
                    }
                },
            };

            this._videoReelService.Setup(x => x.GetAllVideoReels()).Returns(videoReel);

            // Act
            var viewModel = new VideoReelListViewModel(this._videoReelService.Object);
            var result    = viewModel.ListAll();

            // Assert
            Assert.AreEqual(viewModel.TotalDuration, TotalNTSCSDVideoDuration);
            Assert.IsTrue(result.Count > 0);

            this._videoReelService.Verify(x => x.GetAllVideoReels(), Times.Once);
            this._videoReelService.VerifyAll();
        }
Exemplo n.º 2
0
        public void Test_Total_Duration_When_Video_Reel_Does_Not_Have_Any_Video_Clips()
        {
            // Arrange
            var videoReel = new List <VideoReel>
            {
                new VideoReel()
                {
                    VideoDefinition = VideoDefinition.SD,
                    VideoStandard   = VideoStandard.PAL,
                    Name            = "Video Five",
                    TotalDuration   = "00:02:11:01",
                    Id         = 1,
                    VideoClips = new List <VideoClip>()
                    {
                    }
                },
            };

            this._videoReelService.Setup(x => x.GetAllVideoReels()).Returns(videoReel);

            // Act
            var viewModel = new VideoReelListViewModel(this._videoReelService.Object, this._videoClipService.Object);
            var result    = viewModel.ListAll();

            // Assert
            Assert.AreEqual(EmptyDuration, viewModel.VideoReels[0].TotalDuration);
            Assert.IsTrue(result.Count > 0);

            this._videoReelService.Verify(x => x.GetAllVideoReels(), Times.Once);
            this._videoReelService.VerifyAll();
        }