public void ReturnsReaderResults( FilePath existing, MutagenPatchersListing listing, CancellationToken cancel, RegistryListingsProvider sut) { sut.FilePathProvider.Path.Returns(existing); sut.ListingReader.Read(default).ReturnsForAnyArgs(listing);
public void Write(MutagenPatchersListing listings) { _fileSystem.File.WriteAllText(_pathProvider.Path, JsonSerializer.Serialize( listings, _jsonOptions.Options)); Console.WriteLine($"{_pathProvider.Path} {(_fileSystem.File.Exists(_pathProvider.Path) ? "exists." : "does not exist!")}"); }
public async Task <MutagenPatchersListing> Clean(MutagenPatchersListing existingListings) { var listed = await _listingsProvider.Get(); var listedSet = listed .Select(x => new ListingKey(x.User, x.Repository)) .ToHashSet(); return(new MutagenPatchersListing() { Repositories = existingListings.Repositories .Where(x => listedSet.Contains(new ListingKey(x.User, x.Repository))) .ToArray() }); }