public void Test_WriteFileGraterThanMaxPossibleSize(int maxPossibleFileContentSize) { File file = new File(TestData.FileName, HelpfulMethods.RandomString(maxPossibleFileContentSize)); FileStorage storage = new FileStorage(Convert.ToInt32(file.getSize() - 1)); Assert.False(storage.write(file)); }
public static List <File> GetFileCollection(int filesQuality, int maxPossibleStringLength) { List <File> files = new List <File>(); while (filesQuality-- > 0) { files.Add(new File($"{HelpfulMethods.RandomString(5)}.txt", HelpfulMethods.RandomString(random.Next(maxPossibleStringLength)))); } return(files); }