import * as assert from 'assert' ; import { getNameFromId , getResourceGroupFromId , getSubscriptionFromId } from '../extension.bundle' ; suite ( "Azure Resource Util" , ( ) => { const resourceId = "/subscriptions/a59d7183-f4a0-4b15-8ecc-9542203d3c54/resourceGroups/apim-rg/providers/Microsoft.ApiManagement/service/apim-service" ; test ( "Parse name from azure resource id" , async ( ) => { const name = getNameFromId ( resourceId ) ; assert . equal ( name , "apim-service" ) ; } ) ; test ( "Parse resource group name from azure resource id" , async ( ) => { const rg = getResourceGroupFromId ( resourceId ) ; assert . equal ( rg , "apim-rg" ) ; } ) ; test ( "Parse subscription from azure resource id" , async ( ) => { const sub = getSubscriptionFromId ( resourceId ) ; assert . equal ( sub , "a59d7183-f4a0-4b15-8ecc-9542203d3c54" ) ; } ) ; } ) ;