public void GetInterCityCallsTest1() { GetIntercityCalls intercityCalls = new GetIntercityCalls(); var calls = intercityCalls.Get(connection); if (calls.Count == 100) { Assert.Pass(); } else { Assert.Fail("В таблице не все записи"); } }
public void DeleateInterCityTest1() { DeleateIntercityCall deleateEvent = new DeleateIntercityCall(); GetIntercityCalls allCalls = new GetIntercityCalls(); DateTime date = DateTime.Today; var calls = allCalls.Get(connection); int ID = 0; bool passFlag = false; foreach (IntercityCallModel call in calls) { if (call.Surname.Equals("TestSur99") && calls.Count == 100) { ID = call.ID; passFlag = true; } } IntercityCallModel model = new IntercityCallModel(ID); deleateEvent.Deleate(model, connection); allCalls = new GetIntercityCalls(); calls = allCalls.Get(connection); foreach (IntercityCallModel call in calls) { if (call.Surname.Equals("TestSur99") && calls.Count != 99) { passFlag = false; } } if (passFlag) { Assert.Pass("Элемент отсутсвует в БД"); } else { Assert.Fail("Ошибка удаления"); } }