Exemple #1
0
        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);
        }
Exemple #2
0
        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) });
        }
Exemple #3
0
        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) });
        }