public void TestStringRandomFill() { string key = "[STRING].[FILL].[X].[50]"; key = StaticDataFactory.PullStaticValue(key); Assert.IsTrue(key.Length == 50); }
public void TestStringFill() { string key = "[STRING].[FILL].[X].[1-50]"; key = StaticDataFactory.PullStaticValue(key); Assert.IsTrue(key.Length >= 1 && key.Length <= 50); }
public void TestDateTimeUTCNowFormat() { string key = "[DATETIME].[NOWUTC].[{0:MM/dd/yy H:mm}]"; string formattedDate = string.Format("{0:MM/dd/yy H:mm}", DateTime.UtcNow); string value = StaticDataFactory.PullStaticValue(key); Assert.AreEqual(value, formattedDate); }
public void TestGuid() { string key = "[NEWGUID]"; key = StaticDataFactory.PullStaticValue(key); Guid newGuid; Assert.IsTrue(Guid.TryParse(key, out newGuid)); }
public void TestDateTimeUTCNowNoFormat() { string key = "[DATETIME].[NOWUTC].[NONE]"; string holder = DateTime.UtcNow.ToString(); string value = StaticDataFactory.PullStaticValue(key); DateTime tempDateTime; Assert.IsTrue(DateTime.TryParse(value, out tempDateTime)); }
public void TestDateTimeHelperFormat() { string holder; string key = "[DATETIMEHELPER].[1 day from now].[{0:MM/dd/yy}]"; key = StaticDataFactory.PullStaticValue(key); holder = string.Format("{0:MM/dd/yy}", DateTime.Today.AddDays(1)); Assert.AreEqual(holder, key); key = "[DATETIMEHELPER].[1 day ago].[{0:MM/dd/yy}]"; key = StaticDataFactory.PullStaticValue(key); holder = string.Format("{0:MM/dd/yy}", DateTime.Today.AddDays(-1)); Assert.AreEqual(holder, key); key = "[DATETIMEHELPER].[2 days from now].[{0:MM/dd/yy}]"; key = StaticDataFactory.PullStaticValue(key); holder = string.Format("{0:MM/dd/yy}", DateTime.Today.AddDays(2)); Assert.AreEqual(holder, key); key = "[DATETIMEHELPER].[2 days ago].[{0:MM/dd/yy}]"; key = StaticDataFactory.PullStaticValue(key); holder = string.Format("{0:MM/dd/yy}", DateTime.Today.AddDays(-2)); Assert.AreEqual(holder, key); key = "[DATETIMEHELPER].[1 week from now].[{0:MM/dd/yy}]"; key = StaticDataFactory.PullStaticValue(key); holder = string.Format("{0:MM/dd/yy}", DateTime.Today.AddDays(7)); Assert.AreEqual(holder, key); key = "[DATETIMEHELPER].[1 week ago].[{0:MM/dd/yy}]"; key = StaticDataFactory.PullStaticValue(key); holder = string.Format("{0:MM/dd/yy}", DateTime.Today.AddDays(-7)); Assert.AreEqual(holder, key); key = "[DATETIMEHELPER].[2 weeks from now].[{0:MM/dd/yy}]"; key = StaticDataFactory.PullStaticValue(key); holder = string.Format("{0:MM/dd/yy}", DateTime.Today.AddDays(14)); Assert.AreEqual(holder, key); key = "[DATETIMEHELPER].[2 weeks ago].[{0:MM/dd/yy}]"; key = StaticDataFactory.PullStaticValue(key); holder = string.Format("{0:MM/dd/yy}", DateTime.Today.AddDays(-14)); Assert.AreEqual(holder, key); key = "[DATETIMEHELPER].[1 month from now].[{0:MM/dd/yy}]"; key = StaticDataFactory.PullStaticValue(key); holder = string.Format("{0:MM/dd/yy}", DateTime.Today.AddMonths(1)); Assert.AreEqual(holder, key); key = "[DATETIMEHELPER].[1 month ago].[{0:MM/dd/yy}]"; key = StaticDataFactory.PullStaticValue(key); holder = string.Format("{0:MM/dd/yy}", DateTime.Today.AddMonths(-1)); Assert.AreEqual(holder, key); key = "[DATETIMEHELPER].[2 months from now].[{0:MM/dd/yy}]"; key = StaticDataFactory.PullStaticValue(key); holder = string.Format("{0:MM/dd/yy}", DateTime.Today.AddMonths(2)); Assert.AreEqual(holder, key); key = "[DATETIMEHELPER].[2 months ago].[{0:MM/dd/yy}]"; key = StaticDataFactory.PullStaticValue(key); holder = string.Format("{0:MM/dd/yy}", DateTime.Today.AddMonths(-2)); Assert.AreEqual(holder, key); key = "[DATETIMEHELPER].[1 year from now].[{0:MM/dd/yy}]"; key = StaticDataFactory.PullStaticValue(key); holder = string.Format("{0:MM/dd/yy}", DateTime.Today.AddYears(1)); Assert.AreEqual(holder, key); key = "[DATETIMEHELPER].[1 year ago].[{0:MM/dd/yy}]"; key = StaticDataFactory.PullStaticValue(key); holder = string.Format("{0:MM/dd/yy}", DateTime.Today.AddYears(-1)); Assert.AreEqual(holder, key); key = "[DATETIMEHELPER].[2 years from now].[{0:MM/dd/yy}]"; key = StaticDataFactory.PullStaticValue(key); holder = string.Format("{0:MM/dd/yy}", DateTime.Today.AddYears(2)); Assert.AreEqual(holder, key); key = "[DATETIMEHELPER].[2 years ago].[{0:MM/dd/yy}]"; key = StaticDataFactory.PullStaticValue(key); holder = string.Format("{0:MM/dd/yy}", DateTime.Today.AddYears(-2)); Assert.AreEqual(holder, key); }
private string PullStaticValue(string key) { return(StaticDataFactory.PullStaticValue(key)); }