protected void SetupLicenseText() { FileSystemHelper helper = new FileSystemHelper(MainActivity.MainContext, MockLogger); string text = helper.GetAssetsFileContents("license/test.txt", true); // substitute the real text with some from our test app List <string> files = new List <string>(); files.Add("file1"); A.CallTo(() => MockFileSystemHelper.GetAssetsFolderFiles("license")).Returns(files); A.CallTo(() => MockFileSystemHelper.GetAssetsFileContents("file1", true)).Returns(text); }
private void AddAllLicenseFiles() { // to add new licenses to this page just place the new licenses text file in the license folder in the assets // each file should just be text, the first line is treated as the title the rest as the body text // subfolder are supported, files and subfolders are sorted alphabetically // to remove a license, delete the file from the license folder in the assets Observables.ResetText?.Invoke(this, null); var files = FileSystemHelper.GetAssetsFolderFiles("license"); if (files == null) { return; } foreach (var file in files) { Logger.Debug(() => $"OpenSourceLicensesViewModel:AddAllLicenseFiles found file {file}"); AddLicenseText(file); } ; Observables.ScrollToTop?.Invoke(this, null); }