Exemplo n.º 1
0
        public void SetUp()
        {
            var content = new StringContent(Properties.Resources.User_Video_Response);
            var http    = new NicoHttpStab(content, content);

            this.handler = new UVideo::UserVideoHandler(http, new LoggerStub(), new VideoInfoContainerStab());
        }
Exemplo n.º 2
0
        public void SetUp()
        {
            var content = new StringContent(Properties.Resources.GithubReleases);
            var http    = new NicoHttpStab(content, content);

            this.checker = new ReleaseChecker(http, new NetWorkHelper(), new LoggerStub());
        }
        public void SetUp()
        {
            var res  = new StringContent(Properties.Resources.IchibaResponse);
            var http = new NicoHttpStab(res, res);

            this.niconicoIchibaHandler = new NiconicoIchibaHandler(http, new NetWorkHelper(), new IchibaHtmlParser());
        }
Exemplo n.º 4
0
        public void SetUp()
        {
            var content = new StringContent(Properties.Resources.API_Mylist_Get);
            var http    = new NicoHttpStab(content, content);

            this.handler = new Mylist::MylistHandler(http, new LoggerStub(), new VideoInfoContainerStab());
        }
Exemplo n.º 5
0
        public void Waybackkeyの取得に失敗した場合()
        {
            var content = new StringContent("error");
            var http    = new NicoHttpStab(content, content);
            var auth    = new OfficialVideoUtils(http);

            Assert.That(async() => await auth.GetWaybackkeyAsync("1234"), Throws.TypeOf <HttpRequestException>())
            ;
        }
Exemplo n.º 6
0
        public async Task Waybackkeryの取得に成功した場合()
        {
            var content = new StringContent("waybackkey=1615124254.eszTcMSplyHZNMoxeW6Hdb4vcTA");
            var http    = new NicoHttpStab(content, content);
            var auth    = new OfficialVideoUtils(http);
            var info    = await auth.GetWaybackkeyAsync("1234");

            Assert.That(info, Is.EqualTo("1615124254.eszTcMSplyHZNMoxeW6Hdb4vcTA"));
        }
Exemplo n.º 7
0
        public async Task 取得に成功した場合()
        {
            var content = new StringContent("threadkey=1611461521.GIWx_XyM-juZoqSIdvEOU9rIYy8&force_184=1");
            var http    = new NicoHttpStab(content, content);
            var auth    = new OfficialVideoUtils(http);
            var info    = await auth.GetAuthInfoAsync("1234");

            Assert.That(info.Force184, Is.EqualTo("1"));
            Assert.That(info.ThreadKey, Is.EqualTo("1611461521.GIWx_XyM-juZoqSIdvEOU9rIYy8"));
        }
Exemplo n.º 8
0
        public void SetUp()
        {
            var ms  = new MemoryStream();
            var bmp = Properties.Resources.Onmyoji_Thumb;

            bmp.Save(ms, ImageFormat.Jpeg);
            var arr  = ms.GetBuffer();
            var http = new NicoHttpStab(new ByteArrayContent(arr), new ByteArrayContent(arr));

            this.cache  = new CacheHandler(new CacheStreamStab());
            this.stream = new CacheStream(http);
        }