123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- using Microsoft.VisualStudio.TestTools.UnitTesting;
- using Servise.Classes;
- using Servise.Forms;
- namespace Test
- {
- [TestClass]
- public class UnitTest1
- {
- [TestMethod]
- public void proverkazapolnenia()
- {
- string log = "";
- string pass = "";
- bool ex = false;
- UserInform userInform = new UserInform();
- bool act = userInform.Avtoriz(log, pass);
- Assert.AreEqual(ex, act);
- }
- [TestMethod]
- public void provVhoda()
- {
- string log = "admin";
- string pass = "admin".GetHashCode().ToString();
- bool ex = true;
- UserInform userInform = new UserInform();
- bool act = userInform.Avtoriz(log, pass);
- Assert.AreEqual(ex, act);
- }
- public void provbezpar()
- {
- string log = "111";
- string pass = "";
- bool ex = false;
- UserInform userInform = new UserInform();
- bool act = userInform.Avtoriz(log, pass);
- Assert.AreEqual(ex, act);
- }
- public void provbezlog()
- {
- string log = "";
- string pass = "111";
- bool ex = false;
- UserInform userInform = new UserInform();
- bool act = userInform.Avtoriz(log, pass);
- Assert.AreEqual(ex, act);
- }
- [TestMethod]
- public void stoimprav()// подсчет стоимости детали
- {
- AddZac c = new AddZac();
- Assert.AreEqual(c.podschet(2, 4), 680);
- }
- [TestMethod]
- public void stoinemprav()// подсчет стоимости детали
- {
- AddZac c = new AddZac();
- Assert.AreEqual(c.podschet(2, 4), 580);
- }
- [TestMethod]
- public void validmail()
- {
- string log = "dreyvania999@gmail.com";
- bool ex = true;
- Main main = new Main();
- bool act = main.IsValidEmail(log);
- Assert.AreEqual(ex, act);
- }
- [TestMethod]
- public void unvalidmail()
- {
- string log = "dreyvania999-gmail.ru";
- bool ex = false;
- Main main = new Main();
- bool act = main.IsValidEmail(log);
- Assert.AreEqual(ex, act);
- }
- }
- }
|