コード例 #1
0
            public void ShouldConvertCustomIAudioMessageToAudioMessage()
            {
                var message = new TestVideoMessage();

                var videoMessage = VideoMessage.Convert(message);

                Assert.AreNotEqual(message, videoMessage);
                Assert.AreEqual(new Uri("https://foo.url"), videoMessage.Url);
                Assert.AreEqual(new Uri("https://foo.previewUrl"), videoMessage.PreviewUrl);
            }
コード例 #2
0
            public void ShouldThrowExceptionWhenPreviewUrlIsNull()
            {
                var message = new VideoMessage()
                {
                    Url = new Uri("https://foo.url")
                };

                ExceptionAssert.Throws <InvalidOperationException>("The preview url cannot be null.", () =>
                {
                    VideoMessage.Convert(message);
                });
            }
コード例 #3
0
            public void ShouldPreserveInstanceWhenValueImageMessage()
            {
                var message = new VideoMessage()
                {
                    Url        = new Uri("https://foo.url"),
                    PreviewUrl = new Uri("https://foo.previewUrl")
                };

                var videoMessage = VideoMessage.Convert(message);

                Assert.AreSame(message, videoMessage);
            }