Beispiel #1
0
        public void TagTest()
        {
            string        id           = TestUtility.TestData[TestUtility.KEY_VIDEO_ID];
            List <string> tag_list     = new List <string>();
            List <bool>   is_lock_list = new List <bool>();

            string test_tag_lock   = "タグ" + Guid.NewGuid().ToString().Replace("-", "").Substring(0, 10);
            string test_tag_unlock = "たぐ" + Guid.NewGuid().ToString().Replace("-", "").Substring(0, 10);

            tag_list.Add(test_tag_lock);
            is_lock_list.Add(true);
            tag_list.Add(test_tag_unlock);
            is_lock_list.Add(false);

            TestUtility.EnsureLogin(network_);

            TestUtility.Message("Running TagTest - Add tags");
            network_.AddTag(tag_list, is_lock_list, id, delegate(string message, int current, int total)
            {
                TestUtility.Message("({0}/{1}){2}", current, total, message);
                TestUtility.Wait();
            });
            string html = network_.GetVideoPage(id);

            Assert.That(html, Text.Contains(test_tag_lock), "TagTest1-1");
            Assert.That(html, Text.Contains(test_tag_unlock), "TagTest1-2");
            TestUtility.Wait(30);
            network_.RemoveTag(test_tag_lock, id);
            html = network_.GetVideoPage(id);
            Assert.That(html, Text.Contains(test_tag_lock), "TagTest1-3");


            TestUtility.Message("Running TagTest - Unlock tag");
            TestUtility.Wait(30);
            network_.UnlockTag(test_tag_lock, id);
            html = network_.GetVideoPage(id);
            Assert.That(html, Text.Contains(test_tag_lock), "TagTest2-1");
            Assert.That(html, Text.Contains(test_tag_unlock), "TagTest2-2");

            TestUtility.Message("Running TagTest - Remove tags");
            TestUtility.Wait(30);
            network_.RemoveTag(test_tag_lock, id);
            TestUtility.Wait(30);
            html = network_.GetVideoPage(id);
            Assert.That(html, Text.DoesNotContain(test_tag_lock), "TagTest3-1");
            Assert.That(html, Text.Contains(test_tag_unlock), "TagTest3-2");
            TestUtility.Wait(30);
            network_.RemoveTag(test_tag_unlock, id);
            TestUtility.Wait(30);
            html = network_.GetVideoPage(id);
            Assert.That(html, Text.DoesNotContain(test_tag_lock), "TagTest3-3");
            Assert.That(html, Text.DoesNotContain(test_tag_unlock), "TagTest3-4");
        }
Beispiel #2
0
 public void AddTags(List <string> tag_list, List <bool> is_lock_list, string video_id)
 {
     msgout_.Write("タグ付けを開始します。動画ID = " + video_id + "\r\n");
     niconico_network_.AddTag(tag_list, is_lock_list, video_id, OnAddTagsEvent);
     msgout_.Write("タグ付けを終了します。\r\n");
 }