Skip to content

Commit

Permalink
Fix issue where default visibility on published file details was inco…
Browse files Browse the repository at this point in the history
…rrect.
  • Loading branch information
babelshift committed May 27, 2020
1 parent 39f163f commit e4ca9b0
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 19 deletions.
7 changes: 4 additions & 3 deletions src/Steam.Models/PublishedFileVisibility.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
namespace Steam.Models
{
public enum PublishedFileVisibility
public enum PublishedFileVisibility : uint
{
Public = 0,
FreindsOnly = 1,
Private = 2
FriendsOnly = 1,
Private = 2,
Unknown = 3
}
}
7 changes: 0 additions & 7 deletions src/Steam.Models/Steam.Models.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Description>Contains classes that are used as data transports between various application, business, and data layers for Steam related APIs.</Description>
<VersionPrefix>3.0.10</VersionPrefix>
<Authors>Justin Skiles</Authors>
<AssemblyName>Steam.Models</AssemblyName>
<PackageId>Steam.Models</PackageId>
<PackageProjectUrl>https://github.com/babelshift/Steam.Models</PackageProjectUrl>
<PackageLicenseUrl>https://raw.githubusercontent.com/babelshift/Steam.Models/master/LICENSE</PackageLicenseUrl>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

Expand Down
5 changes: 3 additions & 2 deletions src/Steam.UnitTests/Steam.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
<UserSecretsId>46a53f4e-b4d4-4fad-b7c9-b777001cfe42</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.3" />
<PackageReference Include="Microsoft.Extensions.Options" Version="3.1.3" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.4" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.4" />
<PackageReference Include="Microsoft.Extensions.Options" Version="3.1.4" />
<PackageReference Include="Microsoft.Extensions.SecretManager.Tools" Version="2.0.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="xunit" Version="2.4.0" />
Expand Down
13 changes: 12 additions & 1 deletion src/Steam.UnitTests/SteamRemoteTests.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Steam.Models;
using SteamWebAPI2.Interfaces;
using System.Net.Http;
using System.Threading.Tasks;
Expand All @@ -15,11 +16,21 @@ public SteamRemoteTests()
}

[Fact]
public async Task GetPublishedFileDetailsAsync_Should_Succeed()
public async Task GetPublishedFileDetailsAsync_Public_Visibility_Should_Succeed()
{
var response = await steamInterface.GetPublishedFileDetailsAsync(1673456286);
Assert.NotNull(response);
Assert.NotNull(response.Data);
Assert.Equal(PublishedFileVisibility.Public, response.Data.Visibility);
}

[Fact]
public async Task GetPublishedFileDetailsAsync_Unknown_Visibility_Should_Succeed()
{
var response = await steamInterface.GetPublishedFileDetailsAsync(2097579725);
Assert.NotNull(response);
Assert.NotNull(response.Data);
Assert.Equal(PublishedFileVisibility.Unknown, response.Data.Visibility);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using Steam.Models;
using SteamWebAPI2.Utilities.JsonConverters;

namespace SteamWebAPI2.Models
{
using SteamWebAPI2.Utilities.JsonConverters;

internal class PublishedFileDetailsResultContainer
{
[JsonProperty("response")]
Expand Down Expand Up @@ -74,7 +74,7 @@ internal class PublishedFileDetails
public DateTime TimeUpdated { get; set; }

[JsonProperty("visibility")]
public uint Visibility { get; set; }
public uint Visibility { get; set; } = (uint)PublishedFileVisibility.Unknown;

[JsonProperty("banned")]
public bool Banned { get; set; }
Expand Down
6 changes: 3 additions & 3 deletions src/SteamWebAPI2/SteamWebAPI2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>This is a .NET library that makes it easy to use the Steam Web API. It conveniently wraps around all of the JSON data and ugly API details with clean methods, structures and classes.</Description>
<VersionPrefix>4.2.3</VersionPrefix>
<VersionPrefix>4.2.4</VersionPrefix>
<Authors>Justin Skiles</Authors>
<AssemblyName>SteamWebAPI2</AssemblyName>
<PackageId>SteamWebAPI2</PackageId>
Expand All @@ -16,8 +16,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="automapper" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.3" />
<PackageReference Include="Microsoft.Extensions.Options" Version="3.1.3" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.4" />
<PackageReference Include="Microsoft.Extensions.Options" Version="3.1.4" />
<PackageReference Include="newtonsoft.json" Version="12.0.3" />
</ItemGroup>

Expand Down

0 comments on commit e4ca9b0

Please sign in to comment.