File tree Expand file tree Collapse file tree
api.Tests/Services_Tests/Profiledata Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ public async Task GetProfileEditorPublications_ReturnsPublications_WhenMatchingU
157157 Assert . Equal ( 2024 , result [ 2 ] . PublicationYear ) ;
158158 Assert . Equal ( "DimProfileOnlyPublication2 Publisher name" , result [ 2 ] . PublisherName ) ;
159159 Assert . Equal ( "" , result [ 2 ] . SelfArchivedAddress ) ;
160- Assert . Equal ( "0 " , result [ 2 ] . SelfArchivedCode ) ;
160+ Assert . Equal ( "" , result [ 2 ] . SelfArchivedCode ) ;
161161 Assert . Equal ( "DimProfileOnlyPublication2 Volume number" , result [ 2 ] . Volume ) ;
162162 // Item meta
163163 Assert . NotNull ( result [ 0 ] . itemMeta ) ;
@@ -193,7 +193,7 @@ public async Task GetProfileEditorPublications_ReturnsPublications_WhenMatchingU
193193 Assert . Equal ( "" , result [ 3 ] . PublisherName ) ;
194194 Assert . Equal ( "" , result [ 3 ] . Volume ) ;
195195 Assert . Equal ( "" , result [ 3 ] . SelfArchivedAddress ) ;
196- Assert . Equal ( "0 " , result [ 3 ] . SelfArchivedCode ) ;
196+ Assert . Equal ( "" , result [ 3 ] . SelfArchivedCode ) ;
197197 // Item meta
198198 Assert . NotNull ( result [ 3 ] . itemMeta ) ;
199199 Assert . Equal ( 23 , result [ 3 ] . itemMeta . Id ) ;
Original file line number Diff line number Diff line change @@ -262,6 +262,13 @@ void ProcessItem(PublicationDto newPublication)
262262 // Parse open access code. If parsing fails, set to 9 (unknown value).
263263 int openAccessCode = int . TryParse ( publicationDto . OpenAccessCodeUnprocessed , out int openAccessCodeParsed ) ? openAccessCodeParsed : 9 ;
264264
265+ // SelfArchivedCode.
266+ string selfArchivedCode = "" ;
267+ if ( ! publicationDto . IsProfileOnlyPublication )
268+ {
269+ selfArchivedCode = ( publicationDto . SelfArchivedCode != null && ( bool ) publicationDto . SelfArchivedCode ) ? "1" : "0" ;
270+ }
271+
265272 publications . Add ( new ProfileEditorPublication ( )
266273 {
267274 ArticleNumberText = publicationDto . ArticleNumberText ,
@@ -288,7 +295,7 @@ void ProcessItem(PublicationDto newPublication)
288295 PublisherName = publicationDto . PublisherName ,
289296 PublicationTypeCode = publicationDto . PublicationTypeCode ,
290297 SelfArchivedAddress = publicationDto . SelfArchivedAddress ,
291- SelfArchivedCode = ( publicationDto . SelfArchivedCode != null && ( bool ) publicationDto . SelfArchivedCode ) ? "1" : "0" ,
298+ SelfArchivedCode = selfArchivedCode ,
292299 Volume = publicationDto . Volume ,
293300 DataSources = publicationDto . DataSources . Select ( dataSourceDto => new ProfileEditorSource ( )
294301 {
You can’t perform that action at this time.
0 commit comments