public void GetAliasWithMappedAlias(ItemAlias alias, string expectedValue) { // Act var sfClient = new ShareFileClient("https://secure.sf-api.com/sf/v3/"); var uri = sfClient.Items.GetAlias(alias); // Assert uri.ToString().Should().Be("https://secure.sf-api.com/sf/v3/Items(" + expectedValue + ")"); }
/// <summary> /// Will return a composed Uri that will point to Items(alias) for the BaseUri /// </summary> /// <returns></returns> public static Uri GetAlias(this IItemsEntity items, ItemAlias alias) { string aliasString; switch (alias) { case ItemAlias.NetworkShareConnectors: aliasString = "c-cifs"; break; case ItemAlias.SharepointConnectors: aliasString = "c-sp"; break; default: aliasString = alias.ToString().ToLower(); break; } return items.GetEntityUriFromId(aliasString); }
/// <summary> /// Will return a composed Uri that will point to Items(alias) for the BaseUri /// </summary> /// <returns></returns> public static Uri GetAlias(this IItemsEntity items, ItemAlias alias) { string aliasString; switch (alias) { case ItemAlias.NetworkShareConnectors: aliasString = "c-cifs"; break; case ItemAlias.SharepointConnectors: aliasString = "c-sp"; break; default: aliasString = alias.ToString().ToLower(); break; } return(items.GetAlias(aliasString)); }