Пример #1
0
        public void DeleteProgramRequest_WhenDatabaseThrowsError_ShouldThrowException()
        {
            //Arrange
            mockDataAccess
            .Setup(x => x.ExecuteNonQuery(
                       It.IsAny <string>(),
                       "prc_ISISProgramRequestDelete_Exception",
                       It.IsAny <CommandType>(),
                       It.IsAny <SqlParameter[]>(),
                       ref It.Ref <List <SqlParameter> > .IsAny))
            .Throws <Exception>();

            //Act and Assert
            Assert.Throws <Exception>(() => programRequest.DeleteProgramRequest(10, 1, "someString", "someString"));

            mockExceptionHandling.VerifyAll();
        }