public async void Task_GetCompanyById_Return_OkResult() { //Arrange var controller = new MarkelController(repository); var companyId = 2; //Act var data = await controller.GetCompany(companyId); //Assert Assert.IsType <OkObjectResult>(data); }
public async void Task_GetCompanyById_Return_ExactCompanyName() { //Arrange var controller = new MarkelController(repository); var companyId = 1; //Act var data = await controller.GetCompany(companyId); //Assert Assert.IsType <OkObjectResult>(data); var okResult = data.Should().BeOfType <OkObjectResult>().Subject; var company = okResult.Value.Should().BeAssignableTo <CompanyViewModel>().Subject; Assert.Equal("Name1", company.Name); }