示例#1
0
        public void TheVendorAPI_UploadSingleClaimBatch()
        {
            method = new StackTrace().GetFrame(0).GetMethod();
            var results = UploadService.CallUploadService(new VendorPackage(client, Document.CreateDocument(claimNotFoundStatusBatch)));

            if (results.claimResults.Length == 0)
            {
                verificationErrors.Append("Vendor API Service Returned an Unexpected Result of Null or Empty");
                Assert.Fail();
            }
            try
            {
                Assert.AreEqual(true, results.noErrors);
            }
            catch (Exception)
            {
                verificationErrors.Append(
                    "Expected VendorAPI Batch to Have No Errors Returned, But Error(s) were returned");
            }
            try
            {
                Assert.AreEqual(ClaimDeletionStatus.ClaimNotFound,
                                results.claimResults[0].ClaimDeletionStatus);
            }
            catch (Exception e)
            {
                verificationErrors.Append(e.Message);
            }
            var claimToDelete = results.claimResults[0].VendorClaimId;

            Helper.CleanUpVendorBatch(claimToDelete);
            endOfTest();
        }
示例#2
0
        [Test] //Bug 2849
        public void TheVendorAPI_UploadBatchWithDuplicateRefD9Segments()
        {
            method  = new StackTrace().GetFrame(0).GetMethod();
            package = new VendorPackage(client, Document.CreateDocument(duplicateRefsBatch));
            var results = UploadService.CallUploadService(package);

            try
            {
                Assert.AreEqual(true, results.thrownException);
            }
            catch (Exception)
            {
                verificationErrors.Append(
                    "Expected Batch That Uploaded With Duplicate Ref D9s To Throw Exception But No Exceptions Were Thrown");
            }
            try
            {
                Assert.AreEqual("Batch import failed.  Batch contains claims with duplicate REF*D9 segments.", results.Exceptions[0].Message);
            }
            catch (AssertionException e)
            {
                verificationErrors.Append(e.Message);
            }
            endOfTest();
        }
示例#3
0
        public void TheVendorAPI_UploadLargeBatchTest()
        {
            method  = new StackTrace().GetFrame(0).GetMethod();
            package = new VendorPackage(client, Document.CreateDocument(hundredTwoClaimsBatch));
            var results = UploadService.CallUploadService(package);

            try
            {
                Assert.AreEqual(true, results.thrownException);
            }
            catch (Exception)
            {
                verificationErrors.Append(
                    "Expected 100 claim batch to throw exceptions, but no exception(s) were thrown");
            }
            try
            {
                Assert.AreEqual("Max claims exceeded. Cannot accept more than 20 claims.", results.Exceptions[0].Message);
            }
            catch (VerificationException e)
            {
                verificationErrors.Append(e);
            }
            endOfTest();
        }
示例#4
0
        public void TheVendorAPI_CallUploadMultipleClaimsSomeWithoutRefD9Test()
        {
            method = new StackTrace().GetFrame(0).GetMethod();

            package = new VendorPackage(client, Document.CreateDocument(halfRefBatch));
            var results = UploadService.CallUploadService(package);

            try
            {
                Assert.AreEqual(true, results.thrownException);
            }
            catch (Exception)
            {
                verificationErrors.Append("Expected Exception To Be Thrown But No Exception Was Thrown");
            }
            bool isMatch = Regex.IsMatch(results.Exceptions[0].Message,
                                         "Missing Vendor Claim Id: A Claim was sent without a Vendor Claim ID, No Claims Imported");

            try
            {
                Assert.AreEqual(true, isMatch);
            }
            catch (Exception)
            {
                verificationErrors.Append(
                    "Unexpected Exception Thrown From Upload Service, Expected Error, \"A Claim was sent without a Vendor Claim ID\"");
            }


            endOfTest();
        }
示例#5
0
        public void TheVendorAPI_UploadClaimsWithoutRefD9Test()
        {
            method = new StackTrace().GetFrame(0).GetMethod();
            var results = UploadService.CallUploadService(new VendorPackage(client, Document.CreateDocument(nonRefD9Batch)));

            if (results.thrownException == false)
            {
                verificationErrors.Append(
                    "Uploaded Batch Excepted to Return Exceptions, but No Exception(s) Were Returned");
                Assert.Fail();
            }
            var  exception = results.Exceptions[0];
            bool matchExpectedExceptionMessage = Regex.IsMatch(exception.Message, "A Claim was sent without a Vendor Claim ID, No Claims Imported");

            try
            {
                Assert.AreEqual(true, matchExpectedExceptionMessage);
            }
            catch (Exception e)
            {
                verificationErrors.Append(
                    "Expected a Returned Error Message that Contained Correct Reason for Failed Uploaded, but Correct Message was Not Returned\n" + e.Message);
            }
            endOfTest();
        }
示例#6
0
        public void TheVendorAPI_UploadVendorReImportedClaimsTest()
        {
            method = new StackTrace().GetFrame(0).GetMethod();
            var results = UploadService.CallUploadService(new VendorPackage(client, Document.CreateDocument(SingleClaimNoErrors)));

            try
            {
                Assert.AreEqual(true, results.noErrors);
            }
            catch (Exception)
            {
                verificationErrors.Append("Expected Upload to throw No Exceptions but Exception(s) were Thrown");
            }
            try
            {
                Assert.AreEqual(0, results.claimResults[0].Errors.Length);
            }
            catch (Exception)
            {
                verificationErrors.Append(
                    "Expected 0 Errors Returned From Batch Upload, but Batch Upload Returned With " +
                    results.claimResults[0].Errors.Length.ToString(CultureInfo.InvariantCulture) + " Errors");
            }
            try
            {
                Assert.AreEqual(ClaimDeletionStatus.ClaimWasReimported, results.claimResults[0].ClaimDeletionStatus);
            }
            catch (Exception)
            {
                verificationErrors.Append("Unexpected ClaimDeletionStatus Value: Expected ClaimWasReimported but was " +
                                          results.claimResults[0].ClaimDeletionStatus.ToString());
            }

            endOfTest();
        }
示例#7
0
        public void TheVendorAPI_UploadUpperBoundLimitBatchTest()
        {
            method  = new StackTrace().GetFrame(0).GetMethod();
            package = new VendorPackage(client, Document.CreateDocument(upperBoundBatch));
            var results = UploadService.CallUploadService(package);

            try
            {
                Assert.AreEqual(false, results.thrownException);
            }
            catch (Exception)
            {
                verificationErrors.Append("Expected 20 claim batch to throw no exceptions, but exception(s) were thrown");
            }

            endOfTest();
        }
示例#8
0
        public void TheVendorAPI_UploadInvalidBatch()
        {
            method  = new StackTrace().GetFrame(0).GetMethod();
            package = new VendorPackage(client, Document.CreateDocument(invalidBatch));
            var results = UploadService.CallUploadService(package);

            try
            {
                //   Assert.AreEqual("", results.Exceptions[0].Message);  //BUG 91 in defect backlog - currently just returns an empty array, no error thrown
            }
            catch (AssertionException e)
            {
                verificationErrors.Append(e.Message);
            }


            endOfTest();
        }
        public void TheVendorAPI_DeleteVendorClaimsTest()
        {
            method = new StackTrace().GetFrame(0).GetMethod();

            var claimsToDelete = new string[18];

            package = VendorPackage.createPackage(client,
                                                  Document.CreateDocument(DocumentType.MedicalClaim, batchToDelete));
            var uploadResults = UploadService.CallUploadService(package);

            try
            {
                Assert.AreEqual(claimsToDelete.Length, uploadResults.claimResults.Length);
            }
            catch (AssertionException)
            {
                verificationErrors.Append("Expected Upload Call To Return " + claimsToDelete.Length +
                                          " But Upload Call Returned " + uploadResults.claimResults.Length);
            }
            for (int i = 0; i < claimsToDelete.Length; i++)
            {
                claimsToDelete[i] = uploadResults.claimResults[i].VendorClaimId;
            }
            var deleteResults = UploadService.CallDeleteClaimService(package, claimsToDelete);

            foreach (var result in deleteResults.claimDeletionStatuses)
            {
                try
                {
                    Assert.AreEqual(ClaimDeletionStatus.Deleted, result);
                }
                catch (Exception e)
                {
                    verificationErrors.Append(e.Message);
                }
            }
            endOfTest();
        }
示例#10
0
        public void TheVendorAPI_UploadClaimsWithMisMatchedCredentials()
        {
            method = new StackTrace().GetFrame(0).GetMethod();
            Client misMatchedCreds = Client.createClient("ZZZ", "demo1", "dental2");
            var    results         = UploadService.CallUploadService(new VendorPackage(misMatchedCreds, Document.CreateDocument(MisMatchedBatch)));

            if (!results.thrownException)
            {
                verificationErrors.Append("MisMatched Credentials Expected Thrown Exception but No Exception was Thrown");
                Assert.Fail();
            }
            bool matchExpectedExceptionMessage = Regex.IsMatch(results.Exceptions[0].Message, "Invalid username or password");

            try
            {
                Assert.AreEqual(true, matchExpectedExceptionMessage);
            }
            catch (Exception)
            {
                verificationErrors.Append(
                    "Expected Error Message Containing Credentials Information but Error Message Was Not As Expected");
            }
            endOfTest();
        }