123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- using System;
- using Microsoft.VisualStudio.TestTools.UnitTesting;
- using System.Windows.Forms;
- using hospital;
- namespace unitTests
- {
- [TestClass]
- public class UnitTest1
- {
- [TestMethod]
- public void analgin100_add1True()
- {
- string nameDrug = "Анальгин";
- int priceDrug = 100;
- string expected = insertDrug.AddDrug(nameDrug, priceDrug);
- string act = "Добавление данных произошло успешно";
- Assert.AreEqual(act, expected);
- }
- [TestMethod]
- public void analgin100_add2False()
- {
- string nameDrug = "Анальгин";
- int priceDrug = 100;
- string expected = insertDrug.AddDrug(nameDrug, priceDrug);
- string act = "Добавление данных произошло успешно";
- Assert.AreNotEqual(act, expected);
- }
- [TestMethod]
- public void analgin100_delete1True()
- {
- string nameDrug = "Анальгин";
- int priceDrug = 100;
- string expected = mainMenu.deleteDrug(nameDrug, priceDrug);
- string act = "Удаление прошло успешно";
- Assert.AreEqual(act, expected);
- }
- [TestMethod]
- public void analgin100_delete2False()
- {
- string nameDrug = "Анальгин";
- int priceDrug = 100;
- string expected = mainMenu.deleteDrug(nameDrug, priceDrug);
- string act = "Удаление прошло успешно";
- Assert.AreNotEqual(act,expected);
- }
- [TestMethod]
- public void patient_add1True()
- {
- string namePatient = "Морозов Андрей Вячеславович";
- string nameEmployee = "Сергеичев Артем Денисович";
- string Disease = "Простуда";
- string Severity = "Легкая";
- string expected = insertPatientCard.addPatient(namePatient, nameEmployee, Disease, Severity);
- string act = "Добавление данных произошло успешно";
- Assert.AreEqual(act, expected);
- }
- [TestMethod]
- public void patient_add2False()
- {
- string namePatient = "Морозов Андрей Вячеславович";
- string nameEmployee = "Сергечев Артем Денисович";
- string Disease = "Простуда";
- string Severity = "Легкая";
- string expected = insertPatientCard.addPatient(namePatient, nameEmployee, Disease, Severity);
- string act = "Добавление данных произошло успешно";
- Assert.AreNotEqual(act, expected);
- }
- [TestMethod]
- public void auth_admin1True()
- {
- string login = "admin";
- string password = "admin";
- string expected = auth.signIn(login,password);
- string act = "Добро пожаловать, админ!";
- Assert.AreEqual(act, expected);
- }
- [TestMethod]
- public void auth_admin2False()
- {
- string login = "amin";
- string password = "admin";
- string expected = auth.signIn(login, password);
- string act = "Добро пожаловать, админ!";
- Assert.AreNotEqual(act, expected);
- }
- [TestMethod]
- public void auth_user1True()
- {
- string login = "artem";
- string password = "artem";
- string expected = auth.signIn(login, password);
- string act = "Успешная авторизация!";
- Assert.AreEqual(act, expected);
- }
- [TestMethod]
- public void auth_user2False()
- {
- string login = "artem";
- string password = "artem231";
- string expected = auth.signIn(login, password);
- string act = "Успешная авторизация!!";
- Assert.AreNotEqual(act, expected);
- }
- }
- }
|