A:a2018.1.6f1ţ˙˙˙˙˙’3$řĚuń옲e+ Í=^7€˙˙˙˙€Ś€˛€ЀŚ€Ś€Ś€#Ś€+H€3˙˙˙˙€1€1€˙˙˙˙@ހ€ Q€j€ H€<˙˙˙˙ €1€1€˙˙˙˙ @ހ€ Q€j€Ő€I˙˙˙˙€1€1€˙˙˙˙Ŕހ€H€j€˙˙˙˙€1€1€˙˙˙˙@ހ€Q€j€™€PAssetMetaDataguiddata[0]data[1]data[2]data[3]pathNameoriginalNamelabelsassetStoreRef ˙˙ŢšőRkVc}­j˘9Ź­;Ę7€˙˙˙˙€Ś€˛€ Ő€ ހ#€.€,€†€Ä€ ހ#€.€,€H€Ť€˙˙˙˙€1€1€˙˙˙˙ @ހ€ Q€j€ ń€5˙˙˙˙ €1€1€˙˙˙˙ €ހ€€j€˙˙˙˙€G›€˙˙˙˙€H€]˙˙˙˙€1€1€˙˙˙˙@ހ€Q€j€H€b˙˙˙˙€1€1€˙˙˙˙@ހ€Q€j€H€k˙˙˙˙€1€1€˙˙˙˙@ހ€Q€j€y€ € ހ#€.€,€Ő€p˙˙˙˙ €1€1€˙˙˙˙!Ŕހ€"€j€˙˙˙˙#€H€›€˙˙˙˙$€1€1€˙˙˙˙%@ހ€&Q€j€'y€ € (ހ#)€.€,*€ €„+@ž€“ ,@ހ#-€.€,.€H€˜˙˙˙˙/€1€1€˙˙˙˙0@ހ€1Q€j€2H€Ł˙˙˙˙3€1€1€˙˙˙˙4@ހ€5Q€j€6H€ľ˙˙˙˙7€1€1€˙˙˙˙8@ހ€9Q€j€:MonoImporterPPtrm_FileIDm_PathIDm_ExternalObjectsSourceAssetIdentifiertypeassemblynamem_DefaultReferencesexecutionOrdericonm_UserDatam_AssetBundleNamem_AssetBundleVariants˙˙˙8-l'€Łć„hŒÎA,Œ€7€˙˙˙˙€Ś€˛€Ő€ ހ€.€€†€Ä€ ހ€.€€H€Ť€˙˙˙˙€1€1€˙˙˙˙ @ހ€ Q€j€ H€ę€˙˙˙˙ €1€1€˙˙˙˙ @ހ€Q€j€ń€(˙˙˙˙€1€1€˙˙˙˙€ހ€€j€˙˙˙˙€H€›€˙˙˙˙€1€1€˙˙˙˙@ހ€Q€j€y€ € ހ€.€€y€< ހ€.€€ހCH€T˙˙˙˙€1€1€˙˙˙˙ @ހ€!Q€j€"H€`˙˙˙˙#€1€1€˙˙˙˙$@ހ€%Q€j€&H€l˙˙˙˙'€1€1€˙˙˙˙(@ހ€)Q€j€*L€{+PPtrm_FileIDm_PathIDm_DefaultReferencesm_Iconm_ExecutionOrderm_ClassNamem_Namespacem_AssemblyNamem_IsEditorScriptppDŕyŻ¸Š)ZމTNbžwEwz‰¨¤HPackages/com.unity.package-manager-ui/Tests/Editor/Common/PackageSets.cs PackageSets)using System.Collections.Generic; using System.Linq; using System.Text; namespace UnityEditor.PackageManager.UI.Tests { internal class PackageSets { private static readonly PackageSets _instance = new PackageSets(); public static PackageSets Instance { get { return _instance; } } private static readonly System.Random Random = new System.Random(); private static string RandomString(int length) { const string chars = "abcdefghijklmnopqrstuvwxyz"; return new string(Enumerable.Repeat(chars, length) .Select(s => s[Random.Next(s.Length)]).ToArray()); } private static readonly string[] Words = new[] { "lorem", "ipsum", "dolor", "sit", "amet", "consectetuer", "adipiscing", "elit", "sed", "diam", "nonummy", "nibh", "euismod", "tincidunt", "ut", "laoreet", "dolore", "magna", "aliquam", "erat" }; private static string LoremIpsum(int numParagraphs, int minSentences, int maxSentences, int minWords, int maxWords) { var result = new StringBuilder(); for (var p = 0; p < numParagraphs; p++) { var numSentences = Random.Next(maxSentences - minSentences) + minSentences + 1; for (var s = 0; s < numSentences; s++) { var numWords = Random.Next(maxWords - minWords) + minWords + 1; for (var w = 0; w < numWords; w++) { if (p == 0 && s == 0 && w == 0) { result.Append("Lorem ipsum dolor sit"); } else { if (w == 0) { var firstWord = Words [Random.Next (Words.Length)]; firstWord = char.ToUpper (firstWord [0]) + firstWord.Substring (1); result.Append (firstWord); } else { result.Append (" "); result.Append (Words [Random.Next (Words.Length)]); } } } result.Append(". "); } result.Append(System.Environment.NewLine); result.Append(System.Environment.NewLine); } return result.ToString(); } private int _count = 0; public PackageInfo Single(string name = null, string version = null) { var type = Random.NextDouble() > 0.5 ? PackageOrigin.Unknown : PackageOrigin.Registry; return Single(type, name, version); } public PackageInfo Single(PackageOrigin type, string name = null, string version = null) { if (name == null) name = RandomString(Random.Next(5, 10)); if (version == null) { version = string.Format("1.0.{0}", _count); if (Random.NextDouble() > 0.5) version += "-preview"; } var group = UpmBaseOperation.GroupName(type); var package = new PackageInfo { DisplayName = char.ToUpper(name[0]) + name.Substring(1), Name = string.Format("com.unity.{0}", name), Description = LoremIpsum(Random.Next(3,5), 2, 10, 5, 20), PackageId = string.Format("com.unity.{0}@{1}", name, version), State = PackageState.UpToDate, Group = group, Version = version, IsVerified = false, IsCurrent = true, IsLatest = false, Origin = type, Errors = new List() }; _count++; return package; } public List Many(int count, bool onlyPackageGroup = false) { return Many(null, count, onlyPackageGroup); } public List Many(string name, int count, bool onlyPackageGroup = false) { var packages = new List(); for (var i = 0; i < count; i++) { var package = Single(name); packages.Add(package); } // At least one is set to a module and one to a package if (packages.Count > 1) { packages[0].Group = PackageGroupOrigins.Packages.ToString(); packages[1].Group = PackageGroupOrigins.BuiltInPackages.ToString(); } if (onlyPackageGroup) packages.SetGroup(PackageGroupOrigins.Packages.ToString()); if (name != null) { packages.SetCurrent(false); packages.SetLatest(false); if (count > 1) { packages.First().IsCurrent = true; packages.First().IsLatest = false; packages.Last().IsCurrent = false; packages.Last().IsLatest = true; } else { packages.First().IsCurrent = true; packages.First().IsLatest = true; } } return packages.OrderBy(p => p.DisplayName).ToList(); } public List TestData() { var packages = Many(5); packages[0].State = PackageState.UpToDate; packages[1].State = PackageState.Outdated; packages[2].State = PackageState.InProgress; packages[3].State = PackageState.Error; return packages; } // Package that actually exist. Useful when using test package that will be added to manifest public List RealPackages() { var packages = new List(); // Don't add this package if it exists if (PackageCollection.Instance.GetPackageByName("a") == null) { var package = new PackageInfo { DisplayName = "A", Name = "a", Description = LoremIpsum(Random.Next(3, 5), 2, 10, 5, 20), PackageId = "a@1.0.1", State = PackageState.UpToDate, Version = "1.0.1", Group = PackageGroupOrigins.Packages.ToString(), IsCurrent = true, IsLatest = true, Errors = new List() }; packages.Add(package); } if (PackageCollection.Instance.GetPackageByName("b") == null) { var package = new PackageInfo { DisplayName = "B", Name = "b", Description = LoremIpsum(Random.Next(3, 5), 2, 10, 5, 20), PackageId = "b@1.0.1", State = PackageState.UpToDate, Version = "1.0.1", Group = PackageGroupOrigins.Packages.ToString(), IsCurrent = true, IsLatest = true, Errors = new List() }; packages.Add(package); } if (PackageCollection.Instance.GetPackageByName("c") == null) { var package = new PackageInfo { DisplayName = "C", Name = "c", Description = LoremIpsum(Random.Next(3, 5), 2, 10, 5, 20), PackageId = "c@1.0.1", State = PackageState.UpToDate, Version = "1.0.1", Group = PackageGroupOrigins.Packages.ToString(), IsCurrent = true, IsLatest = true, Errors = new List() }; packages.Add(package); } if (PackageCollection.Instance.GetPackageByName("d") == null) { var package = new PackageInfo { DisplayName = "NonExistingVersion(d)", Name = "d", Description = "Non existing package", //LoremIpsum(Random.Next(3, 5), 2, 10, 5, 20), PackageId = "d@4.0.0", State = PackageState.UpToDate, Version = "4.0.0", Group = PackageGroupOrigins.Packages.ToString(), IsCurrent = true, IsLatest = true, Errors = new List() }; packages.Add(package); } if (PackageCollection.Instance.GetPackageByName("nonexistingpackage") == null) { var package = new PackageInfo { DisplayName = "NonExistingPackage", Name = "nonexistingpackage", Description = LoremIpsum(Random.Next(3, 5), 2, 10, 5, 20), PackageId = "nonexistingpackage@0.0.1", State = PackageState.UpToDate, Version = "0.0.1", Group = PackageGroupOrigins.Packages.ToString(), IsCurrent = true, IsLatest = true, Errors = new List() }; packages.Add(package); } return packages; } public List Outdated() { const string name = "TestOutdated"; var packageA = Single(PackageOrigin.Registry, name, "0.0.1"); var packageB = Single(PackageOrigin.Registry, name, "0.0.2"); packageA.State = PackageState.Outdated; packageB.IsCurrent = true; packageB.IsLatest = false; packageB.State = PackageState.UpToDate; packageB.IsCurrent = false; packageB.IsLatest = true; var packages = new List {packageA, packageB}; return packages; } } } PackageSets#UnityEditor.PackageManager.UI.Tests&Unity.PackageManagerUI.EditorTests.dll