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); } } }