Esempio n. 1
0
        public async Task Retrieve_Long_Url_For_Given_Short_Url()
        {
            var givenUrl    = "MccLSngp";
            var expectedUrl = "https://www.microsoft.com/en-my/";
            SubjectUrlForAzureTable subjectUrl = new SubjectUrlForAzureTable(givenUrl, connectionString);
            var result = await subjectUrl.DeshortenUrlFromAzureTable();

            Assert.Equal(result, expectedUrl);
        }
Esempio n. 2
0
        /// <summary>
        /// Do the action to short or deshort URL
        /// </summary>
        /// <returns>Shorten or Deshorten URL</returns>
        public async Task <string> ExecuteAction()
        {
            if (urlAction == UrlAction.Short)
            {
                return(await url.ShortenUrlAndSaveToAzureTable());
            }

            else
            {
                return(await url.DeshortenUrlFromAzureTable());
            }
        }