public void DeleteTaErrorTest() { //// Arrange var errors = new List<string>(); var mockRepository = new Mock<ITARepository>(); var taservice = new TaService(mockRepository.Object); var ta = new TA { TA_Id = string.Empty }; //// Act taservice.DeleteTA(ta, ref errors); //// Assert Assert.AreEqual(1, errors.Count); }
public string DeleteTA(TA ta) { var errors = new List<string>(); var repository = new TARepository(); var service = new TaService(repository); service.DeleteTA(ta, ref errors); if (errors.Count == 0) { return "ok"; } return "error"; }