Beispiel #1
0
        public void TestAddExchangeVisitor_ExchangeVisitorAlreadyAdded()
        {
            var sevisOrgId      = "org id";
            var batchId         = BatchId.NewBatchId();
            var sevisUsername   = "******";
            var sevisId         = "sevisId";
            var instance        = new StagedSevisBatch(batchId, sevisUsername, sevisOrgId);
            var exchangeVisitor = GetExchangeVisitor(sevisId, 1, 2);
            var participant     = new SevisGroupedParticipantDTO
            {
                ParticipantId     = exchangeVisitor.Person.ParticipantId,
                SevisCommStatusId = SevisCommStatus.QueuedToSubmit.Id,
            };

            var previouslySubmittedExchangeVisitor = GetPreviouslySubmittedExchangeVisitor(sevisId, 1, 2);

            Assert.IsTrue(exchangeVisitor.GetChangeDetail(previouslySubmittedExchangeVisitor).HasChanges());

            instance.AddExchangeVisitor(participant, exchangeVisitor, previouslySubmittedExchangeVisitor);
            Assert.AreEqual(1, instance.GetExchangeVisitors().Count());

            instance.AddExchangeVisitor(participant, exchangeVisitor, previouslySubmittedExchangeVisitor);
            Assert.AreEqual(1, instance.GetExchangeVisitors().Count());
        }
Beispiel #2
0
        public void TestConstructor()
        {
            var sevisOrgId    = "org id";
            var batchId       = BatchId.NewBatchId();
            var sevisUsername = "******";
            var maxCreated    = 10;
            var maxUpdated    = 20;
            var instance      = new StagedSevisBatch(batchId, sevisUsername, sevisOrgId, maxCreated, maxUpdated);

            Assert.IsNotNull(instance.BatchId);
            Assert.AreEqual(batchId, instance.BatchId);
            Assert.AreEqual(sevisOrgId, instance.SevisOrgId);
            Assert.AreEqual(sevisUsername, instance.SevisUsername);

            Assert.IsNotNull(instance.SevisBatchProcessing);
            Assert.AreEqual(batchId.ToString(), instance.SevisBatchProcessing.BatchId);
            Assert.AreEqual(sevisOrgId, instance.SevisBatchProcessing.SevisOrgId);
            Assert.AreEqual(sevisUsername, instance.SevisBatchProcessing.SevisUsername);
            Assert.AreEqual(0, instance.SevisBatchProcessing.UploadTries);
            Assert.AreEqual(0, instance.SevisBatchProcessing.DownloadTries);

            Assert.IsNotNull(instance.SEVISBatchCreateUpdateEV);
            Assert.AreEqual(sevisUsername, instance.SEVISBatchCreateUpdateEV.userID);
            Assert.IsNotNull(instance.SEVISBatchCreateUpdateEV.BatchHeader);
            Assert.AreEqual(batchId.ToString(), instance.SEVISBatchCreateUpdateEV.BatchHeader.BatchID);
            Assert.AreEqual(sevisOrgId, instance.SEVISBatchCreateUpdateEV.BatchHeader.OrgID);

            Assert.IsNull(instance.SEVISBatchCreateUpdateEV.CreateEV);
            Assert.IsNull(instance.SEVISBatchCreateUpdateEV.UpdateEV);

            Assert.IsNotNull(instance.GetExchangeVisitors());
            Assert.AreEqual(0, instance.GetExchangeVisitors().Count());

            Assert.AreEqual(maxCreated, instance.MaxCreateExchangeVisitorRecordsPerBatch);
            Assert.AreEqual(maxUpdated, instance.MaxUpdateExchangeVisitorRecordPerBatch);
        }