-
-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for method podcast.searchPodcast (#1572)
## List of changes - added support for method podcast.searchPodcast from list of methods in issue: #1222 - old podcast methods marked as *Deprecated* ( **Warning**: vk support team said, that api for podcast is offline ) - added new model *VkNet/Model/Results/Podcasts/PodcastSearchInfo.cs* and rebuilded model *VkNet/Model/Results/Podcasts/PodcastsSearchResult.cs* for support new format of answer from api method - rebuilded test sources and test cases for 'podcast.searchPodcast' method [Source for podcast.searchPodcast](https://dev.vk.com/ru/method/podcasts.searchPodcast) ## Additional info about podcast methods ![изображение](https://github.com/vknet/vk/assets/9554636/89360618-30ea-4d91-99f7-abdf50056d29) --------- Co-authored-by: inyutin-maxim <[email protected]>
- Loading branch information
1 parent
7a674f5
commit af9ca74
Showing
10 changed files
with
386 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
using FluentAssertions; | ||
using VkNet.Tests.Infrastructure; | ||
using Xunit; | ||
|
||
namespace VkNet.Tests.Categories.Podcasts; | ||
|
||
public class SearchPodcastTest : CategoryBaseTest | ||
{ | ||
protected override string Folder => "Podcasts"; | ||
|
||
[Fact] | ||
public void SearchPodcast() | ||
{ | ||
Url = "https://api.vk.com/method/podcasts.searchPodcast"; | ||
|
||
ReadCategoryJsonPath(nameof(Api.Podcasts.SearchPodcast)); | ||
|
||
var result = Api.Podcasts.SearchPodcast(new() | ||
{ | ||
SearchString = "наука", | ||
Offset = 0, | ||
Count = 100 | ||
}); | ||
|
||
result.Should(). | ||
NotBeNull(); | ||
|
||
result.ResultsTotal. | ||
Should(). | ||
Be(32); | ||
|
||
result.Podcasts[0]. | ||
OwnerUrl. | ||
Should(). | ||
Be("https://vk.com/science_in_palm"); | ||
|
||
result.Podcasts[0]. | ||
Title. | ||
Should(). | ||
Be("Наука в Ладошке"); | ||
|
||
result.Podcasts[0]. | ||
Covers. | ||
Sizes[0]. | ||
Width. | ||
Should(). | ||
Be(640); | ||
|
||
result.Podcasts[0]. | ||
Covers. | ||
Sizes[0]. | ||
Type. | ||
Should(). | ||
Be("a"); | ||
|
||
result.Podcasts[4]. | ||
Title. | ||
Should(). | ||
Be("Noosphere Studio | Наука"); | ||
|
||
result.Podcasts[4]. | ||
OwnerUrl. | ||
Should() | ||
.Be("https://vk.com/noosphere_studio"); | ||
|
||
result.Podcasts[4]. | ||
Covers. | ||
Sizes[1]. | ||
Type. | ||
Should() | ||
.Be("c"); | ||
|
||
result.Podcasts[4]. | ||
Covers. | ||
Sizes[2]. | ||
Height. | ||
Should(). | ||
Be(160); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.