Exemplo n.º 1
0
        public void TestCanAccomodate_SevisIdIsEmpty()
        {
            var sevisOrgId      = "org id";
            var batchId         = BatchId.NewBatchId();
            var sevisUsername   = "******";
            var instance        = new StagedSevisBatch(batchId, sevisUsername, sevisOrgId);
            var exchangeVisitor = GetExchangeVisitor(string.Empty, 1, 2);
            var participant     = new SevisGroupedParticipantDTO
            {
                ParticipantId     = exchangeVisitor.Person.ParticipantId,
                SevisCommStatusId = SevisCommStatus.QueuedToSubmit.Id,
            };

            Assert.IsTrue(instance.CanAccomodate(participant, exchangeVisitor, sevisUsername, sevisOrgId));
        }
Exemplo n.º 2
0
        public void TestCanAccomodate_CreateEVArrayIsNotNull()
        {
            var sevisOrgId    = "org id";
            var batchId       = BatchId.NewBatchId();
            var sevisUsername = "******";
            var instance      = new StagedSevisBatch(batchId, sevisUsername, sevisOrgId);

            instance.SEVISBatchCreateUpdateEV.CreateEV = new List <SEVISEVBatchTypeExchangeVisitor>().ToArray();
            var exchangeVisitor = GetExchangeVisitor(null, 1, 2);
            var participant     = new SevisGroupedParticipantDTO
            {
                ParticipantId     = exchangeVisitor.Person.ParticipantId,
                SevisCommStatusId = SevisCommStatus.QueuedToSubmit.Id,
            };

            Assert.IsTrue(instance.CanAccomodate(participant, exchangeVisitor, sevisUsername, sevisOrgId));
        }
Exemplo n.º 3
0
        public void TestCanAccomodate_SevisIdHasValue_PreviouslySubmittedExchangeVisitorIsNull()
        {
            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    expectedMessage = "The previously submitted exchange visitor must be supplied, since the exchange visitor has a sevis id.";
            Action a = () => instance.CanAccomodate(participant, exchangeVisitor, sevisUsername, sevisOrgId, null);

            a.ShouldThrow <NotSupportedException>().WithMessage(expectedMessage);
        }
Exemplo n.º 4
0
        public void TestCanAccomodate_SevisIdHasValue()
        {
            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());
            Assert.IsTrue(instance.CanAccomodate(participant, exchangeVisitor, sevisUsername, sevisOrgId, previouslySubmittedExchangeVisitor));
        }
Exemplo n.º 5
0
        public void TestCanAccomodate_ExchangeVisitorIsQueuedToValidate()
        {
            var sevisOrgId    = "org id";
            var batchId       = BatchId.NewBatchId();
            var sevisUsername = "******";
            var sevisId       = "sevisId";
            var instance      = new StagedSevisBatch(batchId, sevisUsername, sevisOrgId);

            instance.SEVISBatchCreateUpdateEV.UpdateEV = new List <SEVISEVBatchTypeExchangeVisitor1>().ToArray();
            var exchangeVisitor = GetExchangeVisitor(sevisId, 1, 2);
            var participant     = new SevisGroupedParticipantDTO
            {
                ParticipantId     = exchangeVisitor.Person.ParticipantId,
                SevisCommStatusId = SevisCommStatus.QueuedToValidate.Id,
            };
            var previouslySubmittedExchangeVisitor = GetPreviouslySubmittedExchangeVisitor(sevisId, 1, 2);

            Assert.IsTrue(exchangeVisitor.GetChangeDetail(previouslySubmittedExchangeVisitor).HasChanges());
            Assert.IsTrue(instance.CanAccomodate(participant, exchangeVisitor, sevisUsername, sevisOrgId, previouslySubmittedExchangeVisitor));
        }