Closed Aerion closed 4 years ago
Yes, I didn't need the context to be cleared between tests because every call to SaveChanges
throws an exception so there was no record saved to the database. If that's not the case any more obviously this test will fail. Is that an issue ?
That's an issue for the new tests added in #15, as they need to have data first saved before checking if an exception is thrown on the second SaveChanges is called. The products names/IDs were specifically chosen to be different than the ones already specified in the tests, so it's not really a problem right now, but something to keep in mind. If in those tests a GD
product name was chosen and inserted, it could make other tests fail because of the name unicity.
@Aerion This is fixed now. I removed the two tests that you added.
Steps to reproduce:
in
DatabaseTests.cs
, add the two following testsTest1
andTest2
Expected result: the two tests should pass Actual result: one test passes, the other one fails