public async Task FailedToDeleteTestEntry(int id) { // GIVEN //// The connection to the DB is active // WHEN //// The user tries to delete a data entry that doesnt exist // THEN //// The system throws an excpetion //// and displays a log message //// "Unable to delete data entry for key -- TestId: { id }" await Assert.ThrowsAsync <Exception>(() => TestDataProcessor.DeleteTestData(id)); }
public async Task AddNewEntryToDatabaseThenDelete(int id, double frets, double scale) { // GIVEN // Posts data to database for test await PostData(id, frets, scale); int expectedStatusCode = 204; // Expects a "204 No Content" status code after deletion // WHEN // The data is deleted from the DB var testdataStatusCode = await TestDataProcessor.DeleteTestData(id); // THEN // The data entry is no longer in the DB Assert.Equal(expectedStatusCode, testdataStatusCode); }