public IActionResult GetMatch(string matchId, string shardId) { if (matchId == Guid.Empty.ToString()) { return(NotFound()); } return(Ok(ResponseGenerator.GenerateResponse(2, shardId))); }
public async Task ShouldGenerateEmptyObj() { var generator = new ResponseGenerator(); var result = await generator.GenerateResponse(); Assert.Null(result.Value); Assert.Null(result.Error); Assert.Null(result.Success); }
public async Task ShouldGenerateError() { var generator = new ResponseGenerator(); var excMess = "exception"; var result = await generator.GenerateResponse(excMessage : excMess); Assert.Null(result.Value); Assert.Equal(excMess, result.Error); Assert.Equal("false", result.Success); }
public async Task ShouldGenerateSuccess() { var generator = new ResponseGenerator(); var path = $"..\\netcoreapp2.1\\Data\\Invoice.json"; string jsonData; using (StreamReader sr = new StreamReader(path)) { jsonData = sr.ReadToEnd(); } var result = await generator.GenerateResponse(value : jsonData); Assert.NotNull(result.Value); Assert.Null(result.Error); Assert.Equal("true", result.Success); }