Ejemplo n.º 1
0
        public async Task TimeAsync_RedisServer_ServerMethodCorrectResult()
        {
            var result = await _redisServer.TimeAsync();

            Assert.That(result, Is.EqualTo(new DateTime(2014, 12, 3, 11, 23, 12)));
            _serverMock.Verify(x => x.TimeAsync(CommandFlags.None), Times.Once);
        }
Ejemplo n.º 2
0
 public async Task <DateTime?> TimeAsync(CommandFlags flags = CommandFlags.None)
 {
     try
     {
         return(_redisServer == null
   ? null
   : await _redisServer.TimeAsync(flags)
                .ConfigureAwait(false));
     }
     catch (Exception e)
     {
         LogError(e);
         return(null);
     }
 }