public void Insert_test() { Text.Text text = new Text.Text(); text.Add("Added1"); text.Add("Added2"); text.Insert("Inserted", 1); Assert.AreEqual(text.At_index(1), "Inserted"); }
public void Consonant_percentage_test() { Text.Text text = new Text.Text(); text.Add("ab"); text.Add("cu"); double consonants = text.Consonant_percentage(); Assert.AreEqual(consonants, 50); }
public void The_shortest_test() { Text.Text text = new Text.Text(); text.Add("message"); text.Add("message2"); text.Add("test"); //the shortest int result = text.The_shortest(); Assert.AreEqual(result, 4); }
public void Add_test() { Text.Text text = new Text.Text(); text.Add("Sentence"); Assert.IsTrue(text.Sentences_amount() == 1); }
public void Remove_end_spaces_test() { Text.Text text = new Text.Text(); text.Add("Message "); text.Remove_end_spaces(); Assert.AreEqual(text.At_index(0), "Message"); }
public void Clear_test() { Text.Text text = new Text.Text(); text.Add("Sentence"); text.Clear(); Assert.IsTrue(text.Sentences_amount() == 0); }
public void Remove_whitespaces_test() { Text.Text text = new Text.Text(); text.Add("The test message"); text.Remove_whitespaces(); Assert.AreEqual(text.At_index(0), "The test message"); }
static void Main(string[] args) { Text.Text text = new Text.Text(); text.Add(" sentence "); text.Add("we are here"); text.Show(); text.Remove_end_spaces(); text.Remove_begin_spaces(); text.Remove_whitespaces(); Console.WriteLine("- - - - - - - - - -"); text.Show(); Console.ReadKey(); }