public void SetUp() { _dataBytes = new byte[] { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }; _dataBytes1 = new byte[] { 0x10, 0x20, 0x10, 0x20, 0x10, 0x20, 0x10 }; _dataBytes2 = new byte[] { 0x20, 0x10, 0x20, 0x10, 0x10, 0x20, 0x20 }; _data = new List <Exam> { new Exam { Id = 666, Bytes = _dataBytes, Md5 = "grst" }, new Exam { Bytes = _dataBytes1, Md5 = "pqr" }, new Exam { Bytes = _dataBytes2, Md5 = "tvt" }, }.AsQueryable(); _mockSet = new Mock <DbSet <Exam> >(); _mockSet.As <IQueryable <Exam> >().Setup(m => m.Provider).Returns(_data.Provider); _mockSet.As <IQueryable <Exam> >().Setup(m => m.Expression).Returns(_data.Expression); _mockSet.As <IQueryable <Exam> >().Setup(m => m.ElementType).Returns(_data.ElementType); _mockSet.As <IQueryable <Exam> >().Setup(m => m.GetEnumerator()).Returns(() => _data.GetEnumerator()); _mockContext = new Mock <ExamDbContext>(); _mockContext.Setup(c => c.Exams).Returns(_mockSet.Object); _examDbRepository = new ExamDbRepository(_mockContext.Object); _context = new ExamDbContext(); }
public DownloadController(ISkeletDbRepository skeletDbRepository, IExamDbRepository examDbRepository) { _skeletRepo = skeletDbRepository; _examRepo = examDbRepository; }
public UploadController(IExamDbRepository examDbRepository, IStudentDbRepository studentDbRepository) { _examRepo = examDbRepository; _studentRepo = studentDbRepository; }
public ExamDbDataService() { this._examRepository = (IExamDbRepository)Mvx.get_IoCProvider().Resolve <IExamDbRepository>(); this._settingsDataService = (ISettingsDbDataService)Mvx.get_IoCProvider().Resolve <ISettingsDbDataService>(); this._mobileApi = (IDbMobileApi)Mvx.get_IoCProvider().Resolve <IDbMobileApi>(); }