File tree Expand file tree Collapse file tree 3 files changed +28
-8
lines changed
Expand file tree Collapse file tree 3 files changed +28
-8
lines changed Original file line number Diff line number Diff line change 1- using Microsoft . Extensions . Configuration ;
2- using SteamWebAPI2 . Interfaces ;
3- using SteamWebAPI2 . Utilities ;
4- using System ;
5- using System . Collections . Generic ;
1+ using SteamWebAPI2 . Interfaces ;
62using System . Net . Http ;
7- using System . Text ;
83using System . Threading . Tasks ;
94using Xunit ;
105
Original file line number Diff line number Diff line change 1+ using SteamWebAPI2 . Interfaces ;
2+ using System . Net . Http ;
3+ using System . Threading . Tasks ;
4+ using Xunit ;
5+
6+ namespace Steam . UnitTests
7+ {
8+ public class SteamRemoteTests : BaseTest
9+ {
10+ private readonly SteamRemoteStorage steamInterface ;
11+
12+ public SteamRemoteTests ( )
13+ {
14+ steamInterface = factory . CreateSteamWebInterface < SteamRemoteStorage > ( new HttpClient ( ) ) ;
15+ }
16+
17+ [ Fact ]
18+ public async Task GetPublishedFileDetailsAsync_Should_Succeed ( )
19+ {
20+ var response = await steamInterface . GetPublishedFileDetailsAsync ( 1673456286 ) ;
21+ Assert . NotNull ( response ) ;
22+ Assert . NotNull ( response . Data ) ;
23+ }
24+ }
25+ }
Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ public SteamRemoteStorageProfile()
1717 return ( PublishedFileVisibility ) src ;
1818 } ) ;
1919 CreateMap < PublishedFileDetails , PublishedFileDetailsModel > ( )
20- . ForMember ( dest => dest . FileUrl , opts => opts . MapFrom ( source => new Uri ( source . FileUrl ) ) )
21- . ForMember ( dest => dest . PreviewUrl , opts => opts . MapFrom ( source => new Uri ( source . PreviewUrl ) ) ) ;
20+ . ForMember ( dest => dest . FileUrl , opts => opts . MapFrom ( source => ! string . IsNullOrWhiteSpace ( source . FileUrl ) ? new Uri ( source . FileUrl ) : null ) )
21+ . ForMember ( dest => dest . PreviewUrl , opts => opts . MapFrom ( source => ! string . IsNullOrWhiteSpace ( source . FileUrl ) ? new Uri ( source . PreviewUrl ) : null ) ) ;
2222 CreateMap < PublishedFileDetailsResultContainer , IReadOnlyCollection < PublishedFileDetailsModel > > ( )
2323 . ConvertUsing ( ( src , dest , context ) =>
2424 context . Mapper . Map < IList < PublishedFileDetails > , IReadOnlyCollection < PublishedFileDetailsModel > > (
You can’t perform that action at this time.
0 commit comments