Skip to content

Commit

Permalink
Fix warnings (#975)
Browse files Browse the repository at this point in the history
* Add Audio.GetCatalog

* Add Audio.GetCatalog Test

* fix thumb

* Update AudioGetCatalogTest.cs

* Update UsersFields test

* Fix GetCatalog

* Fix GetCatalog Test

* fix some warnings

* fix some warnings 2

* fix latest commit

* Simplify GetCatalog.json

* Simplify GetCatalog.json 2

* Fix AudioGetCatalogTest.cs
  • Loading branch information
Panuchi authored May 5, 2020
1 parent dc6fc32 commit f425b6a
Show file tree
Hide file tree
Showing 111 changed files with 238 additions and 11,564 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using NUnit.Framework;
using VkNet.Tests.Infrastructure;

namespace VkNet.Tests.Categories
namespace VkNet.Tests.Categories.Account
{
[TestFixture]
[ExcludeFromCodeCoverage]
Expand Down
1 change: 0 additions & 1 deletion VkNet.Tests/Categories/Ads/CreateCampaignsTest.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Diagnostics.CodeAnalysis;
using Newtonsoft.Json.Converters;
using NUnit.Framework;
using VkNet.Enums;
using VkNet.Enums.SafetyEnums;
Expand Down
6 changes: 1 addition & 5 deletions VkNet.Tests/Categories/Ads/CreateClientsTest.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
using System;
using System.Diagnostics.CodeAnalysis;
using Newtonsoft.Json.Converters;
using System.Diagnostics.CodeAnalysis;
using NUnit.Framework;
using VkNet.Enums;
using VkNet.Enums.SafetyEnums;
using VkNet.Model;
using VkNet.Model.RequestParams.Ads;
using VkNet.Tests.Infrastructure;
Expand Down
6 changes: 1 addition & 5 deletions VkNet.Tests/Categories/Ads/CreateLookALikeRequestTest.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
using System;
using System.Diagnostics.CodeAnalysis;
using Newtonsoft.Json.Converters;
using System.Diagnostics.CodeAnalysis;
using NUnit.Framework;
using VkNet.Enums;
using VkNet.Enums.SafetyEnums;
using VkNet.Model;
using VkNet.Model.RequestParams.Ads;
using VkNet.Tests.Infrastructure;

namespace VkNet.Tests.Categories.Ads
Expand Down
3 changes: 1 addition & 2 deletions VkNet.Tests/Categories/Ads/DeleteAdsTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Diagnostics.CodeAnalysis;
using NUnit.Framework;
using VkNet.Model.RequestParams.Ads;
using VkNet.Tests.Infrastructure;
Expand Down
3 changes: 1 addition & 2 deletions VkNet.Tests/Categories/Ads/DeleteCampaignsTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Diagnostics.CodeAnalysis;
using NUnit.Framework;
using VkNet.Model.RequestParams.Ads;
using VkNet.Tests.Infrastructure;
Expand Down
3 changes: 1 addition & 2 deletions VkNet.Tests/Categories/Ads/DeleteClientsTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Diagnostics.CodeAnalysis;
using NUnit.Framework;
using VkNet.Model.RequestParams.Ads;
using VkNet.Tests.Infrastructure;
Expand Down
1 change: 0 additions & 1 deletion VkNet.Tests/Categories/Ads/GetBudgetTest.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Diagnostics.CodeAnalysis;
using NUnit.Framework;
using VkNet.Model.RequestParams.Ads;
using VkNet.Tests.Infrastructure;

namespace VkNet.Tests.Categories.Ads
Expand Down
1 change: 0 additions & 1 deletion VkNet.Tests/Categories/Ads/GetRejectionReasonTest.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Diagnostics.CodeAnalysis;
using NUnit.Framework;
using VkNet.Enums.SafetyEnums;
using VkNet.Tests.Infrastructure;

namespace VkNet.Tests.Categories.Ads
Expand Down
1 change: 0 additions & 1 deletion VkNet.Tests/Categories/Ads/GetSuggestionsTest.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Diagnostics.CodeAnalysis;
using NUnit.Framework;
using VkNet.Enums.SafetyEnums;
using VkNet.Model.RequestParams.Ads;
using VkNet.Tests.Infrastructure;

Expand Down
3 changes: 1 addition & 2 deletions VkNet.Tests/Categories/Ads/RemoveOfficeUsersTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Diagnostics.CodeAnalysis;
using NUnit.Framework;
using VkNet.Model.RequestParams.Ads;
using VkNet.Tests.Infrastructure;
Expand Down
7 changes: 1 addition & 6 deletions VkNet.Tests/Categories/Ads/SaveLookalikeRequestResultTest.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
using System;
using System.Diagnostics.CodeAnalysis;
using Newtonsoft.Json.Converters;
using System.Diagnostics.CodeAnalysis;
using NUnit.Framework;
using VkNet.Enums;
using VkNet.Enums.SafetyEnums;
using VkNet.Model;
using VkNet.Model.RequestParams.Ads;
using VkNet.Tests.Infrastructure;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using VkNet.Enums.SafetyEnums;
using VkNet.Tests.Infrastructure;

namespace VkNet.Tests.Categories
namespace VkNet.Tests.Categories.AppWidgets
{
[TestFixture]
[ExcludeFromCodeCoverage]
Expand Down
2 changes: 1 addition & 1 deletion VkNet.Tests/Categories/AppWidgets/GetAppImagesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using VkNet.Enums.SafetyEnums;
using VkNet.Tests.Infrastructure;

namespace VkNet.Tests.Categories
namespace VkNet.Tests.Categories.AppWidgets
{
[TestFixture]
[ExcludeFromCodeCoverage]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using VkNet.Enums.SafetyEnums;
using VkNet.Tests.Infrastructure;

namespace VkNet.Tests.Categories
namespace VkNet.Tests.Categories.AppWidgets
{
[TestFixture]
[ExcludeFromCodeCoverage]
Expand Down
2 changes: 1 addition & 1 deletion VkNet.Tests/Categories/AppWidgets/GetGroupImagesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using VkNet.Enums.SafetyEnums;
using VkNet.Tests.Infrastructure;

namespace VkNet.Tests.Categories
namespace VkNet.Tests.Categories.AppWidgets
{
[TestFixture]
[ExcludeFromCodeCoverage]
Expand Down
2 changes: 1 addition & 1 deletion VkNet.Tests/Categories/AppWidgets/GetImagesByIdTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using NUnit.Framework;
using VkNet.Tests.Infrastructure;

namespace VkNet.Tests.Categories
namespace VkNet.Tests.Categories.AppWidgets
{
[TestFixture]
[ExcludeFromCodeCoverage]
Expand Down
2 changes: 1 addition & 1 deletion VkNet.Tests/Categories/AppWidgets/SaveAppImageTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using NUnit.Framework;
using VkNet.Tests.Infrastructure;

namespace VkNet.Tests.Categories
namespace VkNet.Tests.Categories.AppWidgets
{
[TestFixture]
[ExcludeFromCodeCoverage]
Expand Down
2 changes: 1 addition & 1 deletion VkNet.Tests/Categories/AppWidgets/SaveGroupImageTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using NUnit.Framework;
using VkNet.Tests.Infrastructure;

namespace VkNet.Tests.Categories
namespace VkNet.Tests.Categories.AppWidgets
{
[TestFixture]
[ExcludeFromCodeCoverage]
Expand Down
2 changes: 1 addition & 1 deletion VkNet.Tests/Categories/AppWidgets/Update.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using VkNet.Enums.SafetyEnums;
using VkNet.Tests.Infrastructure;

namespace VkNet.Tests.Categories
namespace VkNet.Tests.Categories.AppWidgets
{
[TestFixture]
[ExcludeFromCodeCoverage]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using VkNet.Model.RequestParams;
using VkNet.Tests.Infrastructure;

namespace VkNet.Tests.Categories
namespace VkNet.Tests.Categories.Apps
{
[TestFixture]
[SuppressMessage("ReSharper", "PublicMembersMustHaveComments")]
Expand Down
4 changes: 2 additions & 2 deletions VkNet.Tests/Categories/Audio/AudioGetBroadcastListTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ public void GetBroadcastListTest()
ReadCategoryJsonPath(nameof(Api.Audio.GetBroadcastList));

var result = Api.Audio.GetBroadcastList().ToList();
var Object = result.FirstOrDefault();
var firstOrDefault = result.FirstOrDefault();

Assert.IsNotEmpty(result);
Assert.NotNull(Object);
Assert.NotNull(firstOrDefault);
}
}
}
12 changes: 6 additions & 6 deletions VkNet.Tests/Categories/Audio/AudioGetCatalogTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ public void GetCatalog()
Assert.AreEqual(result.Items[0].Audios[0].Date.Year, 2020);
Assert.AreEqual(result.Items[0].Audios[0].Album.Thumb.Height, 300);
Assert.AreEqual(result.Items[0].Audios[0].MainArtists[0].Id, "4885835127738846121");
Assert.AreEqual(result.Items[2].Playlists[1].Genres[0].Id, 1);
Assert.AreEqual(result.Items[2].Playlists[1].Original.OwnerId, -2000239709);
Assert.AreEqual(result.Items[2].Playlists[1].Photo.Height, 300);
Assert.AreEqual(result.Items[2].Playlists[1].MainArtists[0].Id, "2488610606427153840");
Assert.AreEqual(result.Items[2].Playlists[1].AlbumType, AudioAlbumType.MainOnly);
Assert.AreEqual(result.Items[14].Items[0].Meta.ContentType, UserOrGroupType.Group);
Assert.AreEqual(result.Items[1].Playlists[0].Genres[0].Id, 1);
Assert.AreEqual(result.Items[1].Playlists[0].Original.OwnerId, -2000239709);
Assert.AreEqual(result.Items[1].Playlists[0].Photo.Height, 300);
Assert.AreEqual(result.Items[1].Playlists[0].MainArtists[0].Id, "2488610606427153840");
Assert.AreEqual(result.Items[1].Playlists[0].AlbumType, AudioAlbumType.MainOnly);
Assert.AreEqual(result.Items[2].Items[0].Meta.ContentType, UserOrGroupType.Group);
}
}
}
2 changes: 0 additions & 2 deletions VkNet.Tests/Categories/Audio/GetPlaylistByIdTest.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Linq;
using NUnit.Framework;
using VkNet.Model.RequestParams;
using VkNet.Tests.Infrastructure;

namespace VkNet.Tests.Categories.Audio
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Linq;
using NUnit.Framework;
using VkNet.Categories;
using VkNet.Model.RequestParams;

namespace VkNet.Tests.Categories.BotsLongPoll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using VkNet.Model.RequestParams.Database;
using VkNet.Tests.Infrastructure;

namespace VkNet.Tests.Categories
namespace VkNet.Tests.Categories.Database
{
[TestFixture]
[ExcludeFromCodeCoverage]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using VkNet.Tests.Infrastructure;
using VkNet.Utils;

namespace VkNet.Tests.Categories
namespace VkNet.Tests.Categories.Execute
{
[ExcludeFromCodeCoverage]
public class ExecuteCategoryTest : CategoryBaseTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using VkNet.Tests.Helper;
using VkNet.Tests.Infrastructure;

namespace VkNet.Tests.Categories
namespace VkNet.Tests.Categories.Fave
{
[TestFixture]
[SuppressMessage("ReSharper", "PublicMembersMustHaveComments")]
Expand Down Expand Up @@ -209,7 +209,7 @@ public void GetPosts_Extended()
Assert.That(wallPost.Reposts.Count, Is.EqualTo(91));
Assert.That(wallPost.Attachments.Count, Is.EqualTo(1));

var video = posts.WallPosts[0].Attachments[0].Instance as Video;
var video = posts.WallPosts[0].Attachments[0].Instance as Model.Attachments.Video;
Assert.That(video, Is.Not.Null);
Assert.That(video.Id, Is.EqualTo(171514588));
Assert.That(video.OwnerId, Is.EqualTo(235845316));
Expand Down Expand Up @@ -302,7 +302,7 @@ public void GetPosts_NotExtended()
Assert.That(wallPost.Reposts.Count, Is.EqualTo(91));
Assert.That(wallPost.Attachments.Count, Is.EqualTo(1));

var video = posts.WallPosts[0].Attachments[0].Instance as Video;
var video = posts.WallPosts[0].Attachments[0].Instance as Model.Attachments.Video;
Assert.That(video, Is.Not.Null);
Assert.That(video.Id, Is.EqualTo(171514588));
Assert.That(video.OwnerId, Is.EqualTo(235845316));
Expand Down
2 changes: 1 addition & 1 deletion VkNet.Tests/Categories/Friends/FriendsCategoryTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using VkNet.Model.RequestParams;
using VkNet.Tests.Infrastructure;

namespace VkNet.Tests.Categories
namespace VkNet.Tests.Categories.Friends
{
[TestFixture]
[ExcludeFromCodeCoverage]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using VkNet.Model.LeadForms;
using VkNet.Tests.Infrastructure;

namespace VkNet.Tests.Categories
namespace VkNet.Tests.Categories.LeadForms
{
[TestFixture]
public class LeadFormsTests : CategoryBaseTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using VkNet.Model.RequestParams.Leads;
using VkNet.Tests.Infrastructure;

namespace VkNet.Tests.Categories
namespace VkNet.Tests.Categories.Leads
{
[ExcludeFromCodeCoverage]
public class LeadsCategoryTests : CategoryBaseTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using VkNet.Model.RequestParams;
using VkNet.Tests.Infrastructure;

namespace VkNet.Tests.Categories
namespace VkNet.Tests.Categories.Likes
{
[TestFixture]
[SuppressMessage("ReSharper", "PublicMembersMustHaveComments")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Diagnostics.CodeAnalysis;

namespace VkNet.Tests.Categories
namespace VkNet.Tests.Categories.Market
{
[ExcludeFromCodeCoverage]
public class MarketCategoryTest : BaseTest
Expand Down
10 changes: 5 additions & 5 deletions VkNet.Tests/Categories/Messages/MessagesCategoryTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,9 @@ public void GetById_NormalCase_Message()
null)
.FirstOrDefault();

Assert.That(msg.Id, Is.EqualTo(265999));
Assert.That(msg?.Id, Is.EqualTo(265999));

Assert.That(msg.Date,
Assert.That(msg?.Date,
Is.EqualTo(new DateTime(2020,
2,
12,
Expand All @@ -241,9 +241,9 @@ public void GetById_NormalCase_Message()
42,
DateTimeKind.Utc)));

Assert.That(msg.Type, Is.EqualTo(MessageType.Sended));
Assert.That(msg.PeerId, Is.EqualTo(228907945));
Assert.That(msg.Attachments.Count, Is.EqualTo(1));
Assert.That(msg?.Type, Is.EqualTo(MessageType.Sended));
Assert.That(msg?.PeerId, Is.EqualTo(228907945));
Assert.That(msg?.Attachments.Count, Is.EqualTo(1));
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Diagnostics.CodeAnalysis;
using NUnit.Framework;
using VkNet.Tests.Infrastructure;

namespace VkNet.Tests.Categories.Messages
{
Expand Down
1 change: 0 additions & 1 deletion VkNet.Tests/Categories/Messages/MessagesGetByIdTests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using NUnit.Framework;
using VkNet.Enums.Filters;

namespace VkNet.Tests.Categories.Messages
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public void GetConversationsById()
Url = "https://api.vk.com/method/messages.getConversationsById";
ReadCategoryJsonPath(nameof(GetConversationsById));

var result = Api.Messages.GetConversationsById(new long[] { 123 }, null);
var result = Api.Messages.GetConversationsById(new long[] { 123 });

Assert.That(1, Is.EqualTo(result.Count));
}
Expand Down
1 change: 0 additions & 1 deletion VkNet.Tests/Categories/Messages/MessagesGetHistoryTest.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.Diagnostics.CodeAnalysis;
using NUnit.Framework;
using VkNet.Model.RequestParams;
using VkNet.Tests.Infrastructure;

namespace VkNet.Tests.Categories.Messages
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using NUnit.Framework;
using VkNet.Model.RequestParams;
using VkNet.Tests.Infrastructure;

namespace VkNet.Tests.Categories.Messages
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Diagnostics.CodeAnalysis;
using NUnit.Framework;
using VkNet.Model.RequestParams;
using VkNet.Tests.Infrastructure;

namespace VkNet.Tests.Categories.Messages
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using NUnit.Framework;
using VkNet.Tests.Infrastructure;

namespace VkNet.Tests.Categories.Messages
{
Expand Down
Loading

0 comments on commit f425b6a

Please sign in to comment.