コード例 #1
0
ファイル: RandomTextTest.cs プロジェクト: hungrydev/TestData
 public void NUGET_MaxLengthTest1()
 {
     for (int i = 1; i < 1000; i++)
     {
          var target = new RandomText(i);
         var actual = target.ToString();
         //length should be greater than i char max
         Assert.IsTrue(actual.Length <=i);
     }
 }
コード例 #2
0
ファイル: RandomTextTest.cs プロジェクト: hungrydev/TestData
        public void NUGET_AddContentParagraphsTest2()
        {
            var target = new RandomText();
            const int numberParagraphs = 1;
            const int minSentences = 4;
            const int maxSentences = minSentences;
            const int minWords = 4;
            const int maxWords = minWords;
            target.AddContentParagraphs(numberParagraphs, minSentences, maxSentences, minWords, maxWords);
            string actualOutput = target.ToString().Replace("\n\n", string.Empty).Trim();

            int numberOfSentances = actualOutput.Split('.').Length - 1;
            int numberOfWords = actualOutput.Split(' ').Length / numberOfSentances;

            Assert.AreEqual(minSentences, numberOfSentances, "Incorrect number of sentances generated.");
            Assert.AreEqual(minWords, numberOfWords, "Incorrect number of words generated");
        }
コード例 #3
0
ファイル: RandomTextTest.cs プロジェクト: hungrydev/TestData
 public void NUGET_ParameterLessTest1()
 {
     var target = new RandomText();
     var actual = target.ToString();
     //length should be greater than 1000 char.
     Assert.IsTrue(actual.Length>1000);
 }