public void ThrowArgumentNullExceptionWhenPassedCategoryNameIsEmpty() { //Arrange var mockedRunRepository = new Mock <IRunRepository>(); Func <IUnitOfWork> mockedUnitOfWorkFactory = () => { return(new Mock <IUnitOfWork>().Object); }; var serviceUnderTest = new RunService(mockedRunRepository.Object, mockedUnitOfWorkFactory); string expectedExceptionMessage = "categoryName"; //Act var exc = Assert.Throws <ArgumentException>(() => { serviceUnderTest.GetRunsInCategory(""); }); //Assert StringAssert.Contains(expectedExceptionMessage, exc.Message); }