public async Task CreatePackages_WithValidData_PackagesCreatedSuccessfully() { //Arrange var packageParameters = _fixture .Build <PackageParameters>() .With(a => a.CountryCode, "PT") .With(a => a.AreaCode, "LB") .CreateMany(100); var parameters = new CreatePackageParameters { Packages = packageParameters }; _mockPackageRepository .Setup(exec => exec.CreatePackages( It.IsAny <IEnumerable <Package> >())) .Returns(Task.CompletedTask); //Act var response = await _packagesController .CreatePackages(parameters) as OkResult; //Assert _mockPackageRepository .Verify(exec => exec.CreatePackages( It.IsAny <IEnumerable <Package> >()), Times.Once); response.StatusCode .Should() .Be((int)HttpStatusCode.OK); }