public void ThatScriptDescriptionReplacesWithoutScript() { ITokenReplacer tp = new TokenReplacer(new ConfigurationService()); string token = TokenEnum.ScriptDescriptionToken; string result = tp.Replace(token); Assert.AreEqual(result, string.Empty); }
public void ThatScriptIdReplacesWithoutScript() { ITokenReplacer tp = new TokenReplacer(); string token = TokenEnum.ScriptIdToken; string result = tp.Replace(token); Assert.That(result, Is.EqualTo(0.ToString(CultureInfo.InvariantCulture))); }
public override void PreRequest(object sender, PreRequestEventArgs e) { base.PreRequest(sender, e); e.Request.Body = new StringHttpBody { BodyString = TokenReplacer.Replace(BodyString, e.WebTest.Context), ContentType = ContentType }; }
public void ThatCurrentDateTimeReplaces() { ITokenReplacer tp = new TokenReplacer(); string token = TokenEnum.CurrentDateTimeToken; string result = tp.Replace(token); Assert.That(result, Is.EqualTo(DateTime.Now.ToString("g"))); }
public void ThatCurrentVersionDoesntFailWithoutVersion() { ITokenReplacer tp = new TokenReplacer(); string token = TokenEnum.CurrentVersionToken; string result = tp.Replace(token); Assert.That(result, Is.EqualTo(0.ToString(CultureInfo.InvariantCulture))); }
public void ThatCurrentUserReplaces() { ITokenReplacer tp = new TokenReplacer(); string token = TokenEnum.CurrentUserToken; string result = tp.Replace(token); Assert.That(result, Is.EqualTo(Environment.UserName)); }
public void ThatCurrentVersionDoesntFailWithoutVersion() { ITokenReplacer tp = new TokenReplacer(new ConfigurationService()); string token = TokenEnum.CurrentVersionToken; string result = tp.Replace(token); Assert.AreEqual(result, 0.ToString(CultureInfo.InvariantCulture)); }
public void ThatScriptDescriptionReplacesWithoutScript() { ITokenReplacer tp = new TokenReplacer(); string token = TokenEnum.ScriptDescriptionToken; string result = tp.Replace(token); Assert.That(result, Is.EqualTo(string.Empty)); }
public void ThatCurrentUserReplaces() { ITokenReplacer tp = new TokenReplacer(new ConfigurationService()); string token = TokenEnum.CurrentUserToken; string result = tp.Replace(token); Assert.AreEqual(result, EnvironmentProvider.Current.UserName); }
public void ThatScriptIdReplacesWithoutScript() { ITokenReplacer tp = new TokenReplacer(new ConfigurationService()); string token = TokenEnum.ScriptIdToken; string result = tp.Replace(token); Assert.AreEqual(result, 0.ToString(CultureInfo.InvariantCulture)); }
public void CorrectlyReplacesToken() { const string script = "X ||Token|| X"; ITokenReplacer replacer = new TokenReplacer { Text = script }; replacer.Replace("Token", "TokenValue"); Assert.AreEqual("X TokenValue X", replacer.Text); }
public void ThatCurrentVersionReplaces() { ITokenReplacer tp = new TokenReplacer(); tp.CurrentVersion = 500; string token = TokenEnum.CurrentVersionToken; string result = tp.Replace(token); Assert.That(result, Is.EqualTo(500.ToString(CultureInfo.InvariantCulture))); }
public void ThatCurrentDateTimeReplaces() { DateTime dateTime = new DateTime(2014, 09, 17, 17, 42, 55); TimeProvider.Current = new MockTimeProvider(dateTime); ITokenReplacer tp = new TokenReplacer(new ConfigurationService()); string token = TokenEnum.CurrentDateTimeToken; string result = tp.Replace(token); Assert.AreEqual(result, dateTime.ToString("g")); }
public void ThatScriptIdReplaces() { ITokenReplacer tp = new TokenReplacer(new ConfigurationService()); tp.Script = new ScriptFile { Id = 1, Description = "1", FileName = "1.sql" }; string token = TokenEnum.ScriptIdToken; string result = tp.Replace(token); Assert.AreEqual(result, 1.ToString(CultureInfo.InvariantCulture)); }
public void ThatScriptIdReplaces() { ITokenReplacer tp = new TokenReplacer(); tp.Script = new ScriptFile() { Id = 1, Description = "1", FileName = "1.sql" }; string token = TokenEnum.ScriptIdToken; string result = tp.Replace(token); Assert.That(result, Is.EqualTo(1.ToString(CultureInfo.InvariantCulture))); }
public void ThatScriptDescriptionReplaces() { ITokenReplacer tp = new TokenReplacer(new ConfigurationService()); tp.Script = new ScriptFile { Id = 1, Description = "1", FileName = "1.sql" }; string token = TokenEnum.ScriptDescriptionToken; string result = tp.Replace(token); Assert.AreEqual(result, "1"); }
public void ThatScriptDescriptionReplaces() { ITokenReplacer tp = new TokenReplacer(); tp.Script = new ScriptFile() { Id = 1, Description = "1", FileName = "1.sql" }; string token = TokenEnum.ScriptDescriptionToken; string result = tp.Replace(token); Assert.That(result, Is.EqualTo("1")); }
public void ThrowsExceptionIfTextNotSetFirst() { ITokenReplacer replacer = new TokenReplacer(); replacer.Replace("Token", "TokenValue"); }