123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- using Microsoft.VisualStudio.TestTools.UnitTesting;
- using System;
- using LibraryRDK;
- namespace UnitTest
- {
- [TestClass]
- public class UnitTest1
- {
- // тесты для функции PatternNumbers
- [TestMethod]
- public void TestMethodPatternNumbersAreEqual()
- {
- Assert.AreEqual(true, InputValidation.PatternNumbers("89999999999"));
- }
- [TestMethod]
- public void TestMethodPatternNumbersAreNotEqual()
- {
- Assert.AreNotEqual(false, InputValidation.PatternNumbers("89999999999"));
- }
- [TestMethod]
- public void TestMethodPatternNumbersIsTruel()
- {
- Assert.IsTrue(InputValidation.PatternNumbers("89999999999"));
- }
- [TestMethod]
- public void TestMethodPatternNumbersIsFalse()
- {
- Assert.IsFalse(InputValidation.PatternNumbers("привет"));
- }
- [TestMethod]
- public void TestMethodPatternNumbersIsInstanceOfType()
- {
- Assert.IsInstanceOfType(InputValidation.PatternNumbers("привет"), typeof(bool));
- }
- [TestMethod]
- public void TestMethodPatternNumbersIsNotInstanceOfType()
- {
- Assert.IsNotInstanceOfType(InputValidation.PatternNumbers("привет"), typeof(int));
- }
- [TestMethod]
- public void TestMethodPatternNumbersIsNotNull()
- {
- Assert.IsNotNull(InputValidation.PatternNumbers("привет"));
- }
- // тесты для функции Pattern
- [TestMethod]
- public void TestMethodPatternAreEqual()
- {
- Assert.AreEqual(true, InputValidation.Pattern("11:00-12:00"));
- }
- [TestMethod]
- public void TestMethodPatternAreNotEqual()
- {
- Assert.AreNotEqual(true, InputValidation.Pattern("привет"));
- }
- [TestMethod]
- public void TestMethodPatternIsTruel()
- {
- Assert.IsTrue(InputValidation.Pattern("11:00-12:00"));
- }
- [TestMethod]
- public void TestMethodPatternIsFalse()
- {
- Assert.IsFalse(InputValidation.Pattern("привет"));
- }
- [TestMethod]
- public void TestMethodPatternIsInstanceOfType()
- {
- Assert.IsInstanceOfType(InputValidation.Pattern("привет"), typeof(bool));
- }
- [TestMethod]
- public void TestMethodPatternIsNotInstanceOfType()
- {
- Assert.IsNotInstanceOfType(InputValidation.Pattern("привет"), typeof(int));
- }
- [TestMethod]
- public void TestMethodPatternIsNotNull()
- {
- Assert.IsNotNull(InputValidation.Pattern("привет"));
- }
- // тесты для функции CheckAuthorization
- [TestMethod]
- public void TestMethodCheckAuthorizationAreEqual()
- {
- Assert.AreEqual(true, InputValidation.CheckAuthorization("логин", "пароль"));
- }
- [TestMethod]
- public void TestMethodCheckAuthorizationAreNotEqual()
- {
- Assert.AreNotEqual(true, InputValidation.CheckAuthorization("", ""));
- }
- [TestMethod]
- public void TestMethodCheckAuthorizationIsTruel()
- {
- Assert.IsTrue(InputValidation.CheckAuthorization("логин", "пароль"));
- }
- [TestMethod]
- public void TestMethodCheckAuthorizationIsFalse()
- {
- Assert.IsFalse(InputValidation.CheckAuthorization("", ""));
- }
- [TestMethod]
- public void TestMethodCheckAuthorizationIsInstanceOfType()
- {
- Assert.IsInstanceOfType(InputValidation.CheckAuthorization("", ""), typeof(bool));
- }
- [TestMethod]
- public void TestMethodCheckAuthorizationIsNotInstanceOfType()
- {
- Assert.IsNotInstanceOfType(InputValidation.CheckAuthorization("", ""), typeof(int));
- }
- [TestMethod]
- public void TestMethodCheckAuthorizationIsNotNull()
- {
- Assert.IsNotNull(InputValidation.CheckAuthorization("", ""));
- }
- // тесты для функции CheckUsers
- [TestMethod]
- public void TestMethodCheckUsersAreEqual()
- {
- Assert.AreEqual(true, InputValidation.CheckUsers("имя", "фамилия", "отчество", "номер", 1, 1));
- }
- [TestMethod]
- public void TestMethodCheckUsersAreNotEqual()
- {
- Assert.AreNotEqual(true, InputValidation.CheckUsers("", "фамилия", "отчество", "номер", 1, 1));
- }
- [TestMethod]
- public void TestMethodCheckUsersIsTruel()
- {
- Assert.IsTrue(InputValidation.CheckUsers("имя", "фамилия", "отчество", "номер", 1, 1));
- }
- [TestMethod]
- public void TestMethodCheckUsersIsFalse()
- {
- Assert.IsFalse(InputValidation.CheckUsers("", "фамилия", "отчество", "номер", 1, 1));
- }
- [TestMethod]
- public void TestMethodCheckUsersIsInstanceOfType()
- {
- Assert.IsInstanceOfType(InputValidation.CheckUsers("", "фамилия", "отчество", "номер", 1, 1), typeof(bool));
- }
- [TestMethod]
- public void TestMethodCheckUsersIsNotInstanceOfType()
- {
- Assert.IsNotInstanceOfType(InputValidation.CheckUsers("", "фамилия", "отчество", "номер", 1, 1), typeof(int));
- }
- [TestMethod]
- public void TestMethodCheckUsersIsNotNull()
- {
- Assert.IsNotNull(InputValidation.CheckUsers("", "фамилия", "отчество", "номер", 1, 1));
- }
- }
- }
|