public void ConsumerEnteringLeavingFacility_WhenDatabaseThrowsError_ShouldThrowException() { //Arrange mockDataAccess .Setup(x => x.ExecuteNonQuery( It.IsAny <string>(), "prc_ISISProgramRequestChangeCPAmounts", It.IsAny <CommandType>(), It.IsAny <SqlParameter[]>(), ref It.Ref <List <SqlParameter> > .IsAny)) .Throws <Exception>(); //Act and Assert Assert.Throws <Exception>(() => programRequest.ConsumerEnteringLeavingFacility(10, 1, DateTime.Now, 1, 1)); mockExceptionHandling.VerifyAll(); }