Implement basic code contracts

This commit is contained in:
JustArchi
2019-01-10 23:44:32 +01:00
parent 0f2a816b92
commit 192656cd02
43 changed files with 213 additions and 64 deletions

View File

@@ -27,6 +27,7 @@
<ItemGroup>
<PackageReference Include="ConfigureAwaitChecker.Analyzer" Version="2.0.0" />
<PackageReference Include="JetBrains.Annotations" Version="2018.2.1" />
<PackageReference Include="SteamKit2" Version="2.1.0" />
<PackageReference Include="System.Composition.AttributedModel" Version="1.3.0-preview.18571.3" />
</ItemGroup>

View File

@@ -22,6 +22,7 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
using JetBrains.Annotations;
using Newtonsoft.Json;
namespace ArchiSteamFarm.CustomPlugins.ExamplePlugin {
@@ -31,7 +32,8 @@ namespace ArchiSteamFarm.CustomPlugins.ExamplePlugin {
internal static class CatAPI {
private const string URL = "https://aws.random.cat";
internal static async Task<string> GetRandomCatURL(WebBrowser webBrowser) {
[ItemCanBeNull]
internal static async Task<string> GetRandomCatURL([NotNull] WebBrowser webBrowser) {
const string request = URL + "/meow";
WebBrowser.ObjectResponse<MeowResponse> response = await webBrowser.UrlGetToJsonObject<MeowResponse>(request).ConfigureAwait(false);