Example #1
0
        public static void MessageInfoVideoTest()
        {
            const string fileId   = "100";
            const int    width    = 1000;
            const int    height   = 10000;
            const int    duration = 1000;
            const string mimeType = "mimeType";
            const int    fileSize = 100;

            dynamic MessageInfoVideo = mMandatoryFieldsMessageInfo;

            MessageInfoVideo.video = VideoInfoObject.GetObject(fileId, width, height, duration,
                                                               PhotoSizeInfoObject.GetObject(fileId, width, height, fileSize), mimeType, fileSize);

            MessageInfo messageInfo = new MessageInfo(MessageInfoVideo);

            //test MessageInfo.Video
            Assert.AreEqual(messageInfo.Video.FileId, fileId);
            Assert.AreEqual(messageInfo.Video.Width, width);
            Assert.AreEqual(messageInfo.Video.Height, height);
            Assert.AreEqual(messageInfo.Video.Duration, duration);
            Assert.AreEqual(messageInfo.Video.MimeType, mimeType);
            Assert.AreEqual(messageInfo.Video.FileSize, fileSize);

            //test MessageInfo.Video.Thumb
            Assert.AreEqual(messageInfo.Video.Thumb.FileId, fileId);
            Assert.AreEqual(messageInfo.Video.Thumb.Width, width);
            Assert.AreEqual(messageInfo.Video.Thumb.Height, height);
            Assert.AreEqual(messageInfo.Video.Thumb.FileSize, fileSize);

            Console.WriteLine(MessageInfoVideo);
        }
Example #2
0
        public static void MessageInfoVideoTest()
        {
            const string fileId   = "100";
            const int    width    = 1000;
            const int    height   = 10000;
            const int    duration = 1000;
            const string mimeType = "mimeType";
            const int    fileSize = 100;

            dynamic messageInfoVideo = MCommonMandatoryFieldsMessageInfo;

            messageInfoVideo.video = VideoInfoObject.GetObject(fileId, width, height, duration,
                                                               MCommonPhotoSizeInfo, mimeType, fileSize);

            MessageInfo messageInfo = new MessageInfo(messageInfoVideo);

            Assert.Multiple(() =>
            {
                //test MessageInfo.Video
                Assert.AreEqual(fileId, messageInfo.Video.FileId);
                Assert.AreEqual(width, messageInfo.Video.Width);
                Assert.AreEqual(height, messageInfo.Video.Height);
                Assert.AreEqual(duration, messageInfo.Video.Duration);
                Assert.AreEqual(mimeType, messageInfo.Video.MimeType);
                Assert.AreEqual(fileSize, messageInfo.Video.FileSize);
            });

            //test MessageInfo.Video.Thumb
            AssertPhotoSizeInfo(messageInfo.Video.Thumb);
        }