Test Database Anywhere?

29 views
Skip to first unread message

Dave Platt

unread,
Jan 22, 2021, 3:27:33 PMJan 22
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

unread,
Jan 26, 2021, 2:17:27 PMJan 26
to MBTA Developers
Hello!

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
Forward
0 new messages