[TestClass] public class PersonManagerTests { [TestMethod] public void Is_getBookDetails_working() { Person person = new Person(); var mock = new Mock(); //_personManager.GetirBookDetails(person); var manager = new PersonManager(mock.Object); if (manager.GetirBookDetails(person) == null) { throw new Exception("null geldi"); } } } public interface IPersonDal : IEntityRepository { List GetBookDetails(Person person); } public class EfPersonDal : EfEntityRepositoryBase, IPersonDal { public List GetBookDetails(Person person) { using (ELibraryContext context = new ELibraryContext()) { var result = from books in context.Books join people in context.People on books.BookId equals people.TakenBookId where books.BookId == person.TakenBookId select new BookDetail { BookId = people.TakenBookId, }; return result.ToList(); } } } public List GetirBookDetails(Person person) { return _personDal.GetBookDetails(person); }