コード例 #1
0
        public void Video_ReturnsToFirstImageAfterLastOne()
        {
            List <string> videoParts = new List <string>();

            videoParts.Add(Convert.ToBase64String(Encoding.UTF8.GetBytes("Video1")));
            videoParts.Add(Convert.ToBase64String(Encoding.UTF8.GetBytes("Video2")));
            videoParts.Add(Convert.ToBase64String(Encoding.UTF8.GetBytes("Video3")));
            videoParts.Add(Convert.ToBase64String(Encoding.UTF8.GetBytes("Video4")));
            videoParts.Add(Convert.ToBase64String(Encoding.UTF8.GetBytes("Video5")));
            videoParts.Add(Convert.ToBase64String(Encoding.UTF8.GetBytes("Video6")));

            AttachmentPreview attachmentPreview = new AttachmentPreview(AttachmentType.Video, videoParts);

            _viewModel = new AttachmentPreviewViewModel(attachmentPreview);

            Assert.AreEqual("Video1", Encoding.UTF8.GetString(_viewModel.VideoPreview));
            _viewModel.ShowNextVideoImage();
            Assert.AreEqual("Video2", Encoding.UTF8.GetString(_viewModel.VideoPreview));
            _viewModel.ShowNextVideoImage();
            Assert.AreEqual("Video3", Encoding.UTF8.GetString(_viewModel.VideoPreview));
            _viewModel.ShowNextVideoImage();
            Assert.AreEqual("Video4", Encoding.UTF8.GetString(_viewModel.VideoPreview));
            _viewModel.ShowNextVideoImage();
            Assert.AreEqual("Video5", Encoding.UTF8.GetString(_viewModel.VideoPreview));
            _viewModel.ShowNextVideoImage();
            Assert.AreEqual("Video6", Encoding.UTF8.GetString(_viewModel.VideoPreview));

            _viewModel.ShowNextVideoImage();
            Assert.AreEqual("Video1", Encoding.UTF8.GetString(_viewModel.VideoPreview));
        }
コード例 #2
0
        public void Image_Sets_IsImage()
        {
            List <string> imageParts = new List <string>();

            imageParts.Add(Convert.ToBase64String(Encoding.UTF8.GetBytes("image")));

            AttachmentPreview attachmentPreview = new AttachmentPreview(AttachmentType.Image, imageParts);

            _viewModel = new AttachmentPreviewViewModel(attachmentPreview);

            Assert.IsTrue(_viewModel.IsImage);
            Assert.IsFalse(_viewModel.IsVideo);
        }
コード例 #3
0
        public void Video_Sets_IsVideo()
        {
            List <string> videoParts = new List <string>();

            videoParts.Add(Convert.ToBase64String(Encoding.UTF8.GetBytes("Video1")));
            videoParts.Add(Convert.ToBase64String(Encoding.UTF8.GetBytes("Video2")));
            videoParts.Add(Convert.ToBase64String(Encoding.UTF8.GetBytes("Video3")));
            videoParts.Add(Convert.ToBase64String(Encoding.UTF8.GetBytes("Video4")));
            videoParts.Add(Convert.ToBase64String(Encoding.UTF8.GetBytes("Video5")));
            videoParts.Add(Convert.ToBase64String(Encoding.UTF8.GetBytes("Video6")));

            AttachmentPreview attachmentPreview = new AttachmentPreview(AttachmentType.Video, videoParts);

            _viewModel = new AttachmentPreviewViewModel(attachmentPreview);

            Assert.IsFalse(_viewModel.IsImage);
            Assert.IsTrue(_viewModel.IsVideo);
        }