public void TestMethodAssertStrings() { var myLogger = new Stf.Utilities.StfLogger { FileName = @"c:\temp\unittestlogger_TestMethodAssertStrings.html" }; var myAsserts = new StfAssert(myLogger); Assert.IsTrue(myAsserts.StringContains("TestStepName 1", "Hejsa", "Hej")); Assert.IsFalse(myAsserts.StringContains("TestStepName 2", "Hejsa", "Bent")); Assert.IsTrue(myAsserts.StringDoesNotContain("TestStepName 3", "Hejsa", "Bent")); Assert.IsFalse(myAsserts.StringDoesNotContain("TestStepName 4", "Hejsa", "Hej")); Assert.IsTrue(myAsserts.StringMatches("TestStepName 5", "Hejsa", "^He.*")); Assert.IsFalse(myAsserts.StringMatches("TestStepName 6", "Hejsa", "Nix.*")); Assert.IsTrue(myAsserts.StringDoesNotMatch("TestStepName 7", "Hejsa", "Nix.*")); Assert.IsFalse(myAsserts.StringDoesNotMatch("TestStepName 8", "Hejsa", "^He.*")); Assert.IsTrue(myAsserts.StringStartsWith("TestStepName 9", "Hejsa", "He")); Assert.IsFalse(myAsserts.StringStartsWith("TestStepName 10", "Hejsa", "hej")); Assert.IsTrue(myAsserts.StringDoesNotStartWith("TestStepName 11", "Hejsa", "hej")); Assert.IsFalse(myAsserts.StringDoesNotStartWith("TestStepName 12", "Hejsa", "He")); Assert.IsTrue(myAsserts.StringEndsWith("TestStepName 13", "Hejsa", "jsa")); Assert.IsFalse(myAsserts.StringEndsWith("TestStepName 14", "Hejsa", "Hej")); Assert.IsTrue(myAsserts.StringDoesNotEndsWith("TestStepName 15", "Hejsa", "Bent")); Assert.IsFalse(myAsserts.StringDoesNotEndsWith("TestStepName 16", "Hejsa", "ejsa")); Assert.IsTrue(myAsserts.StringEquals("TestStepName 17", "Hejsa", "Hejsa")); Assert.IsFalse(myAsserts.StringEquals("TestStepName 18", "Hejsa", "hejsa")); Assert.IsTrue(myAsserts.StringNotEquals("TestStepName 19", "Hejsa", "hejsa")); Assert.IsFalse(myAsserts.StringNotEquals("TestStepName 20", "Hejsa", "Hejsa")); Assert.IsTrue(myAsserts.StringEqualsCi("TestStepName 21", "Hejsa", "hejsa")); Assert.IsFalse(myAsserts.StringEqualsCi("TestStepName 22", "Hejsa", "hej")); Assert.IsTrue(myAsserts.StringNotEqualsCi("TestStepName 23", "Hejsa", "hejs")); Assert.IsFalse(myAsserts.StringNotEqualsCi("TestStepName 24", "Hejsa", "hejsa")); Assert.IsTrue(myAsserts.StringEmpty("TestStepName 25", string.Empty)); Assert.IsFalse(myAsserts.StringEmpty("TestStepName 26", "Hejsa")); Assert.IsTrue(myAsserts.StringNotEmpty("TestStepName 27", "Hejsa")); Assert.IsFalse(myAsserts.StringNotEmpty("TestStepName 28", string.Empty)); }
/// <summary> /// The mark wrap for sale. /// </summary> /// <param name="wrap"> /// The wrap. /// </param> /// <param name="typeOfSale"> /// The type of the sale /// </param> /// <returns> /// The <see cref="bool"/>. /// </returns> private bool MarkWrapForSale(IWrap wrap, string typeOfSale) { StfAssert.IsNotNull("Wrap", wrap); StfAssert.IsNotNull("typeOfSale", typeOfSale); StfAssert.StringNotEmpty("typeOfSale", typeOfSale); WrapTrackShell.WebAdapter.Click(By.Id("penStatus")); SelectDropdownByIdAndText("selCarrierStatus", typeOfSale); return(WrapTrackShell.WebAdapter.Click(By.Id("butOkNewStatus"))); }
/// <summary> /// The does news exist. /// </summary> /// <param name="wrapId"> /// The wrap id. /// </param> /// <param name="chapterText"> /// The chapter text. /// </param> /// <returns> /// The <see cref="bool"/>. /// </returns> private bool DoesNewsExist(string wrapId, string chapterText) { StfAssert.StringNotEmpty("WrapId", wrapId); var news = WrapTrackShell.News(); var newsEntry = news.GetNewsEntryCarrierStory(wrapId, chapterText); StfAssert.IsNotNull("NewsEntry", newsEntry); return(true); }
/// <summary> /// The does news exist. /// </summary> /// <param name="modelName"> /// The model name /// </param> /// <param name="criteriaText"> /// The review text /// </param> /// <returns> /// The <see cref="bool"/>. /// </returns> private bool DoesNewsOfCarrierEvaluationExist(string modelName, string criteriaText) { StfAssert.StringNotEmpty("modelId", modelName); StfAssert.StringNotEmpty("criteriaText", criteriaText); var news = WrapTrackShell.News(); var newsEntry = news.GetNewsEntryCarrierEvaluation(modelName, criteriaText); StfAssert.IsNotNull("NewsEntry", newsEntry); return(true); }
/// <summary> /// The does news exist. /// </summary> /// <param name="wrapId"> /// The wrap id. /// </param> /// <param name="typeOfSale"> /// The type of the sale /// </param> /// <returns> /// The <see cref="bool"/>. /// </returns> private bool DoesNewsOfCarrierForSaleExist(string wrapId, string typeOfSale) { StfAssert.StringNotEmpty("WrapId", wrapId); StfAssert.StringNotEmpty("typeOfSale", typeOfSale); var news = WrapTrackShell.News(); var newsEntry = news.GetNewsEntryCarrierForSale(wrapId, typeOfSale); StfAssert.IsNotNull("NewsEntry", newsEntry); return(true); }
/// <summary> /// The does news exist. /// </summary> /// <param name="modelName"> /// The model name /// </param> /// <param name="reviewText"> /// The review text /// </param> /// <returns> /// The <see cref="bool"/>. /// </returns> private bool DoesNewsOfCarrierReviewExist(string modelName, string reviewText) { StfAssert.StringNotEmpty("modelId", modelName); StfAssert.StringNotEmpty("reviewText", reviewText); var news = WrapTrackShell.News(); var newsEntry = news.GetNewsEntryCarrierReview(modelName, reviewText); StfAssert.IsNotNull("NewsEntry", newsEntry); return(true); }
/// <summary> /// The get to wrap. /// </summary> /// <param name="wrapId"> /// The wrap id. /// </param> /// <returns> /// The <see cref="IWrap"/>. /// </returns> private IWrap GetToWrap(string wrapId) { StfAssert.StringNotEmpty("Got ID of new wrap", wrapId); var wtApi = Get <IWtApi>(); var wrapInfoBefore = wtApi.WrapInfoByTrackId(wrapId); var internalId = wrapInfoBefore.InternalId; // Move to the new wrap var retVal = WrapTrackShell.GetToWrap(internalId); return(retVal); }
/// <summary> /// The mark wrap for review. /// </summary> /// <param name="wrap"> /// The wrap. /// </param> /// <param name="reviewText"> /// The text to add to the review /// </param> /// <returns> /// The <see cref="bool"/>. /// </returns> private bool WriteReviewForWrap(IWrap wrap, string reviewText) { StfAssert.IsNotNull("Wrap", wrap); StfAssert.IsNotNull("reviewText", reviewText); StfAssert.StringNotEmpty("reviewText", reviewText); WrapTrackShell.WebAdapter.Click(By.Id("butReview")); // mostly for demo purposes - you can follow what happens WrapTrackShell.WebAdapter.WaitForComplete(1); var elem = WrapTrackShell.WebAdapter.FindElement(By.XPath("//textarea[@name='fortaelling']")); elem.SendKeys(reviewText); WrapTrackShell.WebAdapter.WaitForComplete(1); WrapTrackShell.WebAdapter.Click(By.Id("butSaveReviewOneLang")); return(true); }
public void Tc006() { WrapTrackShell.Login(); var me = WrapTrackShell.Me(); StfAssert.IsNotNull("Got a MeProfile", me); var collection = me.GetCollection(); StfAssert.IsNotNull("Got my collection", collection); //var numBefore = collection.NumOfWraps(); var newWrap = collection.AddWrap("Ali Dover", "Hygge", "blue"); //var numAfter = collection.NumOfWraps(); StfAssert.StringNotEmpty("Got ID of new wrap", newWrap); }
public void DataDrivenSummaryLogTestEscapeCurlyParenthesisTest() { var testDescription = (string)TestContext.DataRow["Test Description"]; StfAssert.StringNotEmpty("Description not empty", testDescription); }