private string FormatQAbstractStorageEntryToBucketInfo(QAbstractStorageEntry entity, bool humanReadable) { string sizeFormat = null; if (humanReadable) { sizeFormat = this.ConvertBytes.ConvertToHumanReadable(entity.Size, 2); } else { sizeFormat = entity.Size.ToString(); } return(string.Format("{0,7} - {1}", sizeFormat, entity.Name)); }
public override async Task <List <QAbstractStorageEntry> > ListEntriesAsync(string folder, CancellationToken cancellationToken) { Mock <QAbstractStorageEntry> mockAStorage = new Mock <QAbstractStorageEntry>(); string path = "test/path"; mockAStorage.Setup(foo => foo.Size).Returns(123456); mockAStorage.Setup(foo => foo.Name).Returns(path); QAbstractStorageEntry entity = mockAStorage.Object; await Task.Delay(20); return(new List <QAbstractStorageEntry>() { entity }); }