public void FindByIdAsync_Should_Retrieve_Correct_Item() { var repo = new CourseJsonRepository("./Data/courses.json"); var wpfCourse = repo.FindById(2); wpfCourse.CourseName.Should().Be("Apprendre WPF avec Prism"); wpfCourse.Id.Should().Be(2); }
public void Remove_Should_Remove_Element_From_JSON_Document() { var repo = new CourseJsonRepository("./Data/courses.json"); var wpfElement = repo.FindById(2); repo.Remove(wpfElement); var elements = repo.GetAll(); elements.Should().HaveCount(2); elements.Any(e => e.Id == 2).Should().BeFalse(); }