Exemplo n.º 1
0
        public async Task Get_ReturnsNotFound_WhenUserDoesNotExist()
        {
            GithubUserController ctrl   = new GithubUserController(_businessContexMock);
            IActionResult        result = await ctrl.Get("non_existent");

            Assert.IsAssignableFrom <NotFoundResult>(result);
        }
Exemplo n.º 2
0
        public async Task Get_ReturnsUser()
        {
            GithubUserController ctrl   = new GithubUserController(_businessContexMock);
            IActionResult        result = await ctrl.Get("horvayev");

            Assert.IsAssignableFrom <OkObjectResult>(result);
            OkObjectResult okResult = result as OkObjectResult;

            Assert.IsType <GithubUser>(okResult.Value);
            GithubUser user = okResult.Value as GithubUser;

            Assert.Equal("horvayev", user.Login);
        }