Example #1
0
        public void Create()
        {
            var link = "exampl.com/sample.mp4";

            var   client = new ClientMock(MockResponse.Video);
            Video video  = LinkUpload.Create(link, client);

            Assert.That(video.record.RecordClient, Is.SameAs(client));

            var tokens = new Dictionary <string, object> ()
            {
                { "url", link },
                { "uploader", "unit link uploader" }
            };

            var video2 = LinkUpload.Create(tokens, client);

            Assert.IsInstanceOf <Video> (video2);
        }
Example #2
0
        public void NewVideo()
        {
            var video = new Video();

            Assert.AreEqual(video.record.RecordEndpoint, "videos");
            Assert.IsInstanceOf <Client> (video.record.RecordClient);

            var client = new ClientMock(MockResponse.Video);

            video = new Video(client);

            Assert.AreEqual(video.record.RecordEndpoint, "videos");
            Assert.IsInstanceOf <Record> (video.record);
            Assert.IsInstanceOf <Client> (video.record.RecordClient);
            Assert.That(video.record.RecordClient, Is.SameAs(client));

            var assignRecord = new Video(video.record);

            Assert.That(assignRecord.record, Is.SameAs(video.record));
        }
Example #3
0
        public void NewPlaylist()
        {
            var playlist = new Playlist();

            Assert.AreEqual(playlist.record.RecordEndpoint, "feeds/playlists");
            Assert.IsInstanceOf <Client> (playlist.record.RecordClient);

            var client = new ClientMock(MockResponse.Playlist);

            playlist = new Playlist(client);

            Assert.AreEqual(playlist.record.RecordEndpoint, "feeds/playlists");
            Assert.IsInstanceOf <Record> (playlist.record);
            Assert.IsInstanceOf <Client> (playlist.record.RecordClient);
            Assert.That(playlist.record.RecordClient, Is.SameAs(client));

            var assignRecord = new Playlist(playlist.record);

            Assert.That(assignRecord.record, Is.SameAs(playlist.record));
        }
Example #4
0
        public void NewCategory()
        {
            var category = new Category();

            Assert.AreEqual(category.record.RecordEndpoint, "categories");
            Assert.IsInstanceOf <Client> (category.record.RecordClient);

            var client = new ClientMock(MockResponse.Category);

            category = new Category(client);

            Assert.AreEqual(category.record.RecordEndpoint, "categories");
            Assert.IsInstanceOf <Record> (category.record);
            Assert.IsInstanceOf <Client> (category.record.RecordClient);
            Assert.That(category.record.RecordClient, Is.SameAs(client));

            var assignRecord = new Category(category.record);

            Assert.That(assignRecord.record, Is.SameAs(category.record));
        }
Example #5
0
        public void NewPreset()
        {
            var preset = new Preset();

            Assert.AreEqual(preset.record.RecordEndpoint, "encoding_presets");
            Assert.IsInstanceOf <Client> (preset.record.RecordClient);

            var client = new ClientMock(MockResponse.Preset);

            preset = new Preset(client);

            Assert.AreEqual(preset.record.RecordEndpoint, "encoding_presets");
            Assert.IsInstanceOf <Record> (preset.record);
            Assert.IsInstanceOf <Client> (preset.record.RecordClient);
            Assert.That(preset.record.RecordClient, Is.SameAs(client));

            var assignRecord = new Preset(preset.record);

            Assert.That(assignRecord.record, Is.SameAs(preset.record));
        }