예제 #1
0
        public IActionResult GetMatch(string matchId, string shardId)
        {
            if (matchId == Guid.Empty.ToString())
            {
                return(NotFound());
            }

            return(Ok(ResponseGenerator.GenerateResponse(2, shardId)));
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }