public void TestMethod_2_minutes() { TimeSpan source = new TimeSpan(0, 0, 2, 0); const string expected = "2 minutes"; string result = DeleteFunc.ConvertToTimeString(source); Assert.AreEqual(result, expected); }
public void TestMethod_1_second() { TimeSpan source = new TimeSpan(0, 0, 0, 1, 0); const string expected = "1 seconde"; string result = DeleteFunc.ConvertToTimeString(source); Assert.AreEqual(result, expected); }
public void TestMethod_string_with_question_mark() { const string source = "What is your age?"; const string expected = "What is your age"; string result = DeleteFunc.RemoveWindowsForbiddenCharacters(source); Assert.AreEqual(result, expected); }
public void TestMethod_string_with_lesser_than() { const string source = "four is lesser than <five"; const string expected = "four is lesser than five"; string result = DeleteFunc.RemoveWindowsForbiddenCharacters(source); Assert.AreEqual(result, expected); }
public void TestMethod_string_with_colon() { const string source = "he said: be happy"; const string expected = "he said be happy"; string result = DeleteFunc.RemoveWindowsForbiddenCharacters(source); Assert.AreEqual(result, expected); }
public void TestMethod_string_with_star() { const string source = "she is a *star"; const string expected = "she is a star"; string result = DeleteFunc.RemoveWindowsForbiddenCharacters(source); Assert.AreEqual(result, expected); }
public void TestMethod_empty_string() { const string source = ""; const string expected = ""; string result = DeleteFunc.RemoveWindowsForbiddenCharacters(source); Assert.AreEqual(result, expected); }
public void TestMethod_no_character_forbidden() { const string source = "A long long time ago in a galaxy far far away"; const string expected = "A long long time ago in a galaxy far far away"; string result = DeleteFunc.RemoveWindowsForbiddenCharacters(source); Assert.AreEqual(result, expected); }
public void TestMethod_3() { const int source = 3; const string expected = "s"; string result = DeleteFunc.Plural(source); Assert.AreEqual(result, expected); }
public void TestMethod_2_seconds_no_millisecond() { TimeSpan source = new TimeSpan(0, 0, 0, 2, 0); const string expected = "2 secondes"; const bool removeZeroArgument = true; string result = DeleteFunc.ConvertToTimeString(source, removeZeroArgument); Assert.AreEqual(result, expected); }
public void TestMethod_0_day_with_zero_argument() { TimeSpan source = new TimeSpan(0, 0, 0, 0, 0); const string expected = "0 jour 0 heure 0 minute 0 seconde 0 milliseconde"; const bool removeZeroArgument = false; string result = DeleteFunc.ConvertToTimeString(source, removeZeroArgument); Assert.AreEqual(result, expected); }
public void TestMethod_filename() { const string source = "filename.txt"; string tmpDateTime = DateTime.Now.ToShortDateString(); tmpDateTime = tmpDateTime.Replace('/', '-'); string expected = $"filename_{tmpDateTime}.txt"; string result = DeleteFunc.AddDateToFileName(source); Assert.AreEqual(result, expected); }