public void Read_All_Repairs_For_Selected_Car() { var repairContextMock = new Mock <DB.Interface.IDatabaseService>(); repairContextMock.Setup(x => x.Repairs).Returns(repairsMock.Object); repairContextMock.Setup(x => x.Cars).Returns(carsMock.Object); var repairService = new RepairService(repairContextMock.Object); var carRepairs = repairService.GetAllByCarId(3); Assert.IsTrue(carRepairs.Count == 2); }