/// <summary> /// Generate the necessary parameters /// </summary> public List <KeyValuePair <string, string> > GetParams() { var p = new List <KeyValuePair <string, string> >(); if (AssetVersions != null) { p.AddRange(AssetVersions.Select(prop => new KeyValuePair <string, string>("AssetVersions", prop.ToString()))); } if (FunctionVersions != null) { p.AddRange(FunctionVersions.Select(prop => new KeyValuePair <string, string>("FunctionVersions", prop.ToString()))); } if (Dependencies != null) { p.Add(new KeyValuePair <string, string>("Dependencies", Dependencies)); } if (Runtime != null) { p.Add(new KeyValuePair <string, string>("Runtime", Runtime)); } return(p); }
public void TestGetResourceVersions() { var enums = Enum.GetValues(typeof(FileRecordInfo.ResourceType)); foreach (var item in enums) { Assert.DoesNotThrow(() => { AssetVersions.GetResourceVersions((FileRecordInfo.ResourceType)item); }); } }
public void TestGetResourceTypeFromVersion() { var enums = Enum.GetValues(typeof(FileRecordInfo.ResourceType)); foreach (var item in enums) { var expectedResourceType = (FileRecordInfo.ResourceType)item; var versions = AssetVersions.GetResourceVersions(expectedResourceType); if (versions.Count > 0) { for (int i = 0; i < versions.Count; ++i) { // TODO: Fix GetResourceVersions now that assets are no longer have a version hash // For now just check version hash versions and not numbered versions. if (versions[i].Length == 16) { var resourceType = AssetVersions.GetResourceTypeFromVersion(versions[i]); Assert.AreEqual(expectedResourceType, resourceType); } } } } }
public void TestGetResourceTypeFromVersionUnknown() { var resourceType = AssetVersions.GetResourceTypeFromVersion("UnknownVersion"); Assert.AreEqual(FileRecordInfo.ResourceType.Unknown, resourceType); }