public void Given_existing_id_web_api_should_return_proper_developer() { var response = _controller.Get(2); var result = response as OkNegotiatedContentResult <DeveloperDto>; Assert.IsNotNull(result); Assert.IsNotNull(result.Content); Assert.AreEqual("Karol", result.Content.FirstName); }
public void DeveloperController_Get_ShouldBeCorrectInt() { var result = _controller.Get(1); Assert.AreEqual(1, _mockService.CallCount); Assert.IsInstanceOfType(result, typeof(OkNegotiatedContentResult <DeveloperDetail>)); }
public async void Get_WhenCalled_ReturnsOkResult() { //Get action from controller var okResult = await _controller.Get(); //Assert if is JsonResult Assert.IsType <JsonResult>(okResult); //Assert if status code was ok Assert.True(((JsonResult)okResult).StatusCode == 200); }
public async Task Get_returns_204_when_no_developer_is_available() { var result = await _controller.Get() as StatusCodeResult; result.Should().BeOfType <NoContentResult>(); }