Example #1
0
        void IsStateSerialized()
        {
            var state = new GameState();

            var newState = _service.DoubleConvert(state);

            Assert.NotNull(newState);
        }
Example #2
0
 protected override Task <ApiResponse <TResponse> > Post <TRequest, TResponse>(TRequest req, Func <TRequest, ApiResponse <TResponse> > handler)
 {
     try {
         var task = base.Post(_convert.DoubleConvert(req), handler);
         var resp = _convert.DoubleConvert(task.Result);
         if (!resp.Success)
         {
             _errorHandle.OnError(resp.Error);
         }
         return(Task.FromResult(resp));
     } catch (Exception e) {
         _logger.Error(this, $"Post: {e}");
         return(Task.FromResult(new ServerError(e.ToString()).AsError <TResponse>()));
     }
 }