1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- using ClassLibrary1;
- namespace TestProject1
- {
- [TestClass]
- public class UnitTest1
- {
- [TestMethod]
- public void TestMethod1()//ïîçèòèâíûé íà ïðîâåðêó òîãî, ÷òî ñëîâî îïðåäåëÿåòñÿ êîððåêòíî
- {
- string stroka = "ìàìà ÿ êîò";
- string expected = "ìàìà";
- Class1 b = new Class1();
- string actual = b.str(stroka);
- Assert.AreEqual(expected, actual);
- }
- [TestMethod]
- public void TestMethod4()//ïîçèòèâíûé íà ïðîâåðêó òîãî, ÷òî â ñòðîêå íàõîäÿòñÿ çíà÷åíèÿ, åñëè ïåðåäàâàòü åìó ñòðîêó ñ ";"
- {
- string stroka = "ìàìà;ÿ;êîò";
- string expected = "ìàìà";
- Class1 b = new Class1();
- string actual = b.str(stroka);
- Assert.AreEqual(expected, actual);
- }
- [TestMethod]
- public void TestMethod3()//ïîçèòèâíûé íà ïðîâåðêó âîçâðàòà íå íóëåâîãî çíà÷åíèÿ
- {
- string stroka = "ìàìà ÿ êîò";
- Class1 b = new Class1();
- string actual = b.str(stroka);
- Assert.IsNotNull(actual);
- }
- [TestMethod]
- public void TestMethod2()//íåãàòèâíûé
- {
- string stroka = "ìàìà ÿ êîò";
- string expected = "ÿ";
- Class1 b = new Class1();
- string actual = b.str(stroka);
- Assert.AreNotEqual(expected, actual);
- }
- }
- }
|