public void GetUserWordById_DifferentUserCourse_ReturnsNull() { var testList = CreateWords(Guid.NewGuid(), 10, 20, false); var context = testList.AsDbSet().MockContext(x => x.Words); var repository = new WordRepository(context); var result = repository.GetUserWordById(10, Guid.NewGuid().ToString()); result.Should().BeNull(); }
public void GetUserWordById_NoCourse_ReturnsNull() { var userId = Guid.NewGuid(); List <Word> testList = CreateWords(userId, 10, 20, true); var context = testList.AsDbSet().MockContext(x => x.Words); var repository = new WordRepository(context); var result = repository.GetUserWordById(30, userId.ToString()); result.Should().BeNull(); }
public void GetUserWordById_UserCourse_ReturnsCourse() { var userId = Guid.NewGuid(); var testList = CreateWords(userId, 10, 20, false); var context = testList.AsDbSet().MockContext(x => x.Words); var repository = new WordRepository(context); var result = repository.GetUserWordById(10, userId.ToString()); result.Id.Should().Be(10); }