jhachtel / AMIS3610-Group-Project

0 stars 0 forks source link

Correct Model List<> Tests #62

Open jhachtel opened 5 years ago

jhachtel commented 5 years ago

The Associate and Disassociate tests are failing. It says there is no object reference being passed. I think there is, but obviously not. The offending code has been commented out.

jhachtel commented 5 years ago

Stopping here for the night.

jhachtel commented 5 years ago

Tests updated. Name issues caused a conflict.

However, tests are failing again because of Fork merges. now working on correcting those.

jhachtel commented 5 years ago

@Demerti @AlexTetzloff @skyarkitekten

Tests fixed. All tests on api Models pass. Will begin building tests for the Web API calls in a new issue.

1) .NET does lots of magical things in the background but one of them isn't initializing declared Lists. Once I initialized the lists in the models I stopped getting the NullReferenceException.

2) "Do not use Contains()" warning was being given the whole time but since it didn't appear in the stack trace I didn't give it credit. Changing the tests to Assert.Empty() and Assert.NotEmpty() to see that the list was adding and removing the objects sufficed to test list functionality. I could then remove one of each pair of objects I created since the second one was no longer needed. Moving the remove methods and empty assertions to the end, after the expected/actual checks, allowed all three tests to be done in one block.

3) Cleaned up the names and field values to make things a bit more obvious to fresh eyes.

I still recommend refactoring the Gear Model to "Item". Gear, not having an appropriate plural, is too ambiguous and is likely causing us issues elsewhere.

Demerti commented 5 years ago

Have the tests been properly modified to Items now from Gears?