Test Database Anywhere?

Skip to first unread message

Dave Platt

Jan 22, 2021, 3:27:33 PM1/22/21
to MBTA Developers
I am writing automated tests for my MBTA commuter rail schedule app. Does there exist a test database, the contents of which are known, to test against?

For example, I have a method that fetches alerts for a specified commuter rail line.  I'd like to test the case in which alerts exist for the line, and also as the case in which no alerts exist for the line. Running on live data, I can't be sure what the result of the test ought to be, so I can't tell for sure if it produced the correct behavior. 

Suggestions? Tx

Developer at MBTA

Jan 26, 2021, 2:17:27 PM1/26/21
to MBTA Developers

Unfortunately there is not a test version of the API like you describe with consistent data. However, many language testing frameworks do have tools for mocking HTTP responses so you may be able to test entirely on your end by playing back the relevant responses that you want to use. If you need help constructing any mock test data, such as questions regarding how the API might respond in a given situation, please feel free to reach out.

Reply all
Reply to author
0 new messages