public void Must_perform_encoding() { var systemUnderTest = new UrlEncoder(); string encodedUrl = systemUnderTest.Encode("?Test=1&Test=2\r"); Assert.That(encodedUrl, Is.EqualTo("%3fTest%3d1%26Test%3d2%0d")); }
public string GenerateQrCodeUri(string email, string unformattedKey) { const string format = "otpauth://totp/{0}:{1}?secret={2}&issuer={0}&digits=6"; return(string.Format(format, _urlEncoder.Encode("www.bidibidi.com"), _urlEncoder.Encode(email), unformattedKey)); }
private static string UrlEncode(string content) { return(_urlEncoder.Encode(content)); }
/// <summary> /// Creates new Scrum team with specified team name and Scrum master name. /// </summary> /// <param name="teamName">Name of the Scrum team.</param> /// <param name="scrumMasterName">Name of the Scrum master.</param> /// <param name="cancellationToken">The cancellation token to cancel operation.</param> /// <returns> /// Created Scrum team. /// </returns> public async Task <ScrumTeam> CreateTeam(string teamName, string scrumMasterName, CancellationToken cancellationToken) { var encodedTeamName = _urlEncoder.Encode(teamName); var encodedScrumMasterName = _urlEncoder.Encode(scrumMasterName); var uri = $"CreateTeam?teamName={encodedTeamName}&scrumMasterName={encodedScrumMasterName}"; var result = await GetJsonAsync <ScrumTeam>(uri, cancellationToken); ConvertScrumTeam(result); return(result); }
private string GenerateQrCodeUri(string email, string unformattedKey) { return(string.Format(AuthenicatorUriFormat, UrlEncoder.Encode("BancoVirtualEstudantilWeb"), UrlEncoder.Encode(email), unformattedKey)); }
public virtual void WriteUrlEncode(string format, params object[] args) { var urlEncode = _urlEncoder.Encode(string.Format(format, args)); Write(urlEncode); }
private string GenerateQrCodeUri(string email, string unformattedKey) => string.Format( AuthenticatorUriFormat, _urlEncoder.Encode("SmartAdmin.WebUI"), _urlEncoder.Encode(email), unformattedKey);