Skip to content

Commit

Permalink
Add support for method podcast.searchPodcast (#1572)
Browse files Browse the repository at this point in the history
## 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
Rahovski and inyutin-maxim authored Aug 13, 2023
1 parent 7a674f5 commit af9ca74
Show file tree
Hide file tree
Showing 10 changed files with 386 additions and 231 deletions.
80 changes: 80 additions & 0 deletions VkNet.Tests/Categories/Podcasts/SearchPodcastTest.cs
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);
}
}
40 changes: 0 additions & 40 deletions VkNet.Tests/Categories/Podcasts/SearchTest.cs

This file was deleted.

160 changes: 0 additions & 160 deletions VkNet.Tests/TestData/Categories/Podcasts/Search.json

This file was deleted.

Loading

0 comments on commit af9ca74

Please sign in to comment.