We are trying to write an Add() and Delete() test with JustMock against the Telerik ORM our gets and updates work fine but not sure what we are missing as we cannot get Adds and Deletes to work.
This is what we have:
emIRIS = Mock.Create<emIRIS>();
Mock.Arrange(() => emIRIS.CourseSections).ReturnsCollection(GetCourseSectionData());
Mock.Arrange(() => emIRIS.FacultyCourseSections).ReturnsCollection(GetFacultyCourseSectionData());
var preResults = emIRIS.FacultyCourseSections.Where(x => x.CourseSection_pk == 20).ToList();
In the above test method we want to delete an item from the collection but nothing happens and the last assert test will fail.
Do we need to Mock the Delete Method on emIRIS to make the delete work? if so how.
And for adding new objects to the collections do we need to Moch the Add method on each collection?