public async Task ShouldCreateCarePackage() { var carePackageCreationRequest = TestDataHelper.CarePackageCreationRequest( serviceUserId: Guid.Parse(UserConstants.DefaultApiUserId), packageType: PackageType.ResidentialCare); var response = await _fixture.RestClient .PostAsync <CarePackagePlainResponse>($"api/v1/care-packages", carePackageCreationRequest) .ConfigureAwait(false); var carePackages = _fixture.DatabaseContext.CarePackages.ToList(); Assert.Equal(HttpStatusCode.OK, response.Message.StatusCode); carePackages.Should().ContainSingle(p => p.Id == response.Content.Id); response.Content.Id.Should().NotBe(Guid.Empty); response.Content.PackageType.Should().Be((int)carePackageCreationRequest.PackageType); response.Content.Status.Should().Be((int)PackageStatus.New); }
public static IEnumerable <object[]> InvalidCarePackageTestData() { yield return(new object[] { TestDataHelper.CarePackageCreationRequest(serviceUserId: Guid.Parse(UserConstants.DefaultApiUserId), packageType: 0) }); yield return(new object[] { TestDataHelper.CarePackageCreationRequest(serviceUserId: Guid.Parse(UserConstants.DefaultApiUserId), packageType: (PackageType)123465) }); }
public static IEnumerable <object[]> ValidCarePackageTestData() { yield return(new object[] { TestDataHelper.CarePackageCreationRequest(serviceUserId: Guid.Parse(UserConstants.DefaultApiUserId), packageType: PackageType.ResidentialCare) }); yield return(new object[] { TestDataHelper.CarePackageCreationRequest(serviceUserId: Guid.Parse(UserConstants.DefaultApiUserId), packageType: PackageType.NursingCare) }); }