public async Task CreateTeamAsync_WithTestTeam_ReturnsCreatedTeam() { // Arrange var teamService = Substitute.For <ITeamService>(); var inputModel = new TeamSubmit() { Uuid = Guid.NewGuid(), Name = "Test Team Name" }; teamService.CreateAsync(inputModel, Arg.Any <Guid>()) .Returns(new Team() { Uuid = inputModel.Uuid, Name = inputModel.Name } ); var controller = new TeamController(teamService, orderByHelper, paginationHelper, mapper); // Act IActionResult actionResult = await controller.CreateTeamAsync(inputModel); // Assert var okResult = actionResult as OkObjectResult; Assert.NotNull(okResult); var team = okResult.Value as Team; Assert.NotNull(team); Assert.True(team.Uuid == inputModel.Uuid, $"Retrieved Id {team.Uuid} not the same as sample id {inputModel.Uuid}."); Assert.True(team.Name == inputModel.Name, $"Retrieved Name {team.Name} not the same as sample Name {inputModel.Name}."); }