You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
downkyi/DownKyi.Core.Test/Test/UnitTest1.cs

36 lines
925 B

using DownKyi.Core.BiliApi.Danmaku;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Net;
namespace DownKyi.Core.Test.Test
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
string url = "https://api.bilibili.com/x/v2/dm/web/seg.so?type=1&oid=421769791&pid=420986799&segment_index=1";
string localFile = @"C:\Users\FlySelf\Desktop\test.proto";
WebClient mywebclient = new WebClient();
mywebclient.DownloadFile(url, localFile);
}
[TestMethod]
public void TestMethod2()
{
var danmakus = DanmakuProtobuf.GetAllDanmakuProto(420986799, 421769791);
Console.WriteLine(danmakus.Count);
foreach (var dan in danmakus)
{
Console.WriteLine(dan.ToString());
}
}
}
}