Added more tests, fixed a bug where Parameters.sampleResourceFailureTime produced negative numbers occasionally.