Пример #1
0
 public IEnumerable<ReadingLog> GetReadings(PagingInfo parameters)
 {
     Entities context = new Entities();
     return context.Readings
         .Skip(() => parameters.Page*parameters.PageSize)
         .Take(() => parameters.PageSize)
         .Select(r => new ReadingLog {Tag = r.Tag, Reader = r.Reader, ReadingDateTime = r.ReadingDateTIme})
         .ToList();
 }
Пример #2
0
        public void GetReadings()
        {
            //Arrange
            PagingInfo parameters = new PagingInfo();
            IEnumerable<ReadingLog> response = new List<ReadingLog>();
            dataAccessMock.Setup(d => d.GetReadings(It.IsAny<PagingInfo>())).Returns(response);

            //Act
            IEnumerable<ReadingLog> result = user.GetReadings(parameters);

            //Assert
            dataAccessMock.VerifyAll();
        }
Пример #3
0
        public void GetReadings()
        {
            //Arrange
            PagingInfo parameters = new PagingInfo();
            List<ReadingInfo> response = new List<ReadingInfo>();
            this.dataAccessMock.Setup(d => d.GetReadings(It.IsAny<PagingInfo>())).Returns(response);

            //Act
            List<ReadingInfo> result = this.user.GetReadings(parameters);

            //Assert
            this.dataAccessMock.VerifyAll();
        }
Пример #4
0
 public IEnumerable<ReadingLog> GetReadings(PagingInfo parameters)
 {
     List<ReadingLog> result = new List<ReadingLog>();
     IMongoCollection<BsonDocument> collection = _db.GetCollection<BsonDocument>("readings");
     BsonDocument filter = new BsonDocument();
     IFindFluent<BsonDocument, BsonDocument> documents = collection.Find(filter);
     result = documents.ToList().Select(d => new ReadingLog
     {
         Reader = d.GetValue("reader").ToString(),
         Tag = d.GetValue("tag").ToString()
     }).ToList();
     return result;
 }
Пример #5
0
 public IEnumerable<ReadingLog> GetReadings(PagingInfo pagingInfo)
 {
     return _dataAccess.GetReadings(pagingInfo);
 }
Пример #6
0
 public IEnumerable<ReadingLog> GetReadings(PagingInfo parameters)
 {
     return _serfidStorage.GetReadings(parameters);
 }
Пример #7
0
 public IEnumerable<ReadingLog> GetReadings()
 {
     PagingInfo pagingInfo = new PagingInfo();
     return _user.GetReadings(pagingInfo);
 }