public void GenerateSteam_ValidPattern() { const string illustrationUrl = "110800"; const IllustrationPlatformEnum platformType = IllustrationPlatformEnum.Steam; var action = new ConstructIllustrationAction(platformType, illustrationUrl); var url = action.Execute(); #region Validate var epoch = EpochHandler.GenerateEpochNow() - 60; Assert.AreEqual("http://cdn.edgecast.steamstatic.com/steam/apps/110800/header.jpg", url.Split(new [] { "?t=" }, StringSplitOptions.RemoveEmptyEntries).First()); Assert.IsTrue(epoch < int.Parse(url.Split(new [] { "?t=" }, StringSplitOptions.RemoveEmptyEntries).Last())); #endregion }
private string GenerateSteamIllustration(string illustrationUrl) { var epochNow = EpochHandler.GenerateEpochNow(); return("http://" + $"cdn.edgecast.steamstatic.com/steam/apps/{illustrationUrl}/header.jpg?t={epochNow}"); }