public void NewsApiTest_Get() { var type = Apis.Material.Enums.MaterialType.voice; //aa5fe50648fb489a8083cdd203370470.jpg var result = api.Get(type); var tempResult = (OtherMaterialResult)result; var wr = new WebRequestHelper(); if (!result.IsSuccess()) { Assert.Fail("获取多图文信息失败,返回结果如下:" + result.DetailResult); } }
public void NewsApiTest_Get() { var type = Apis.Material.Enums.MaterialType.video; //aa5fe50648fb489a8083cdd203370470.jpg var result = api.Get(type); var tempResult = (OtherMaterialResult)result; var videoresult = api.GetMaterialById <GetVideoMaterialResult>(tempResult.Items[0].MediaId); var bytes = RequestUtility.HttpUploadData(videoresult.DownUrl, tempResult.Items[0].MediaId); File.WriteAllBytes("E://Test.mp4", bytes); if (!result.IsSuccess()) { Assert.Fail("获取多图文信息失败,返回结果如下:" + result.DetailResult); } }