public void FindByBetweenDates_DatesDoNotHaveTermsWithinThem_NonexistingEntityExceptionIsThrown() { // arrange var startDate = new DateTime(2019, 1, 1); var endDate = new DateTime(2019, 5, 29); // act and assert var ex = Assert.Throws <NonexistingEntityException>(() => _termService.FindByBetweenDates(startDate, endDate)); Assert.AreEqual("There are no terms in the current date range.", ex.Message); }