Skip to content

Commit

Permalink
unit test nullabel issue
Browse files Browse the repository at this point in the history
  • Loading branch information
qdraw committed Oct 7, 2024
1 parent d1854f1 commit ae6a387
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions starsky/starskytest/FakeMocks/FakeIMetaReplaceService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@ public FakeIMetaReplaceService(List<FileIndexItem>? input = null)
[SuppressMessage("ReSharper", "CollectionNeverQueried.Global")]
public List<FakeIMetaReplaceServiceData> Data { get; set; } = new List<FakeIMetaReplaceServiceData>();

public Task<List<FileIndexItem>> Replace(string f, string fieldName, string search, string replace,
public Task<List<FileIndexItem>> Replace(string f, string fieldName, string search, string? replace,
bool collections)
{
Data.Add(new FakeIMetaReplaceServiceData{f = f,fieldName = fieldName, search = search, replace = replace});
var replaceItem = replace ?? string.Empty;
Data.Add(new FakeIMetaReplaceServiceData{f = f,fieldName = fieldName, search = search, replace = replaceItem});

return Task.FromResult(MetaReplaceService.SearchAndReplace(
_input.Where(p => p.FilePath == f).ToList(), fieldName, search,
replace));
replaceItem));
}
}
}

0 comments on commit ae6a387

Please sign in to comment.