public void TestGetRequestId() { var personId = 100; var participantId = 200; var firstName = "first"; var lastName = "last"; var passport = "passport"; var preferred = "preferred"; var suffix = "Jr."; var fullName = new FullName(firstName, lastName, passport, preferred, suffix); var birthCity = "birth city"; var birthCountryCode = "CN"; var birthDate = DateTime.UtcNow; var citizenshipCountryCode = "FR"; var email = "*****@*****.**"; var gender = Gender.SEVIS_MALE_GENDER_CODE_VALUE; var permanentResidenceCountryCode = "MX"; var phone = "123-456-7890"; var mailAddress = new AddressDTO { AddressId = 1, Country = LocationServiceAddressValidator.UNITED_STATES_COUNTRY_NAME }; var usAddress = new AddressDTO { AddressId = 2, Country = LocationServiceAddressValidator.UNITED_STATES_COUNTRY_NAME }; var printForm = true; var birthCountryReason = USBornReasonType.Item01.ToString(); var sevisId = "sevis id"; var remarks = "remarks"; var relationship = DependentCodeType.Item01.ToString(); var isTravelingWithParticipant = true; var isDeleted = true; var instance = new UpdatedDependent( fullName, birthCity, birthCountryCode, birthCountryReason, birthDate, citizenshipCountryCode, email, gender, permanentResidenceCountryCode, phone, relationship, mailAddress, usAddress, printForm, sevisId, remarks, personId, participantId, isTravelingWithParticipant, isDeleted ); var expectedRequestId = new RequestId(instance.PersonId, RequestIdType.Dependent, RequestActionType.Update); Assert.AreEqual(expectedRequestId, instance.GetRequestId()); }
public void TestGetSevisExhangeVisitorDependentInstance_BirthCountryReasonNotSpecified() { var personId = 100; var participantId = 200; var firstName = "first"; var lastName = "last"; var passport = "passport"; var preferred = "preferred"; var suffix = "Jr."; var fullName = new FullName(firstName, lastName, passport, preferred, suffix); var birthCity = "birth city"; var birthCountryCode = "CN"; var birthDate = DateTime.UtcNow; var citizenshipCountryCode = "FR"; var email = "*****@*****.**"; var gender = Gender.SEVIS_MALE_GENDER_CODE_VALUE; var permanentResidenceCountryCode = "MX"; var phone = "123-456-7890"; var mailAddress = new AddressDTO { AddressId = 1, Country = LocationServiceAddressValidator.UNITED_STATES_COUNTRY_NAME }; var usAddress = new AddressDTO { AddressId = 2, Country = LocationServiceAddressValidator.UNITED_STATES_COUNTRY_NAME }; var printForm = true; string birthCountryReason = null; var sevisId = "sevis id"; var remarks = "remarks"; var relationship = DependentCodeType.Item01.ToString(); var isTravelingWithParticipant = true; var isDeleted = false; var dependent = new UpdatedDependent( fullName: fullName, birthCity: birthCity, birthCountryCode: birthCountryCode, birthCountryReasonCode: birthCountryReason, birthDate: birthDate, citizenshipCountryCode: citizenshipCountryCode, emailAddress: email, gender: gender, permanentResidenceCountryCode: permanentResidenceCountryCode, phoneNumber: phone, relationship: relationship, mailAddress: mailAddress, usAddress: usAddress, printForm: printForm, sevisId: sevisId, remarks: remarks, participantId: participantId, personId: personId, isDeleted: isDeleted, isTravelingWithParticipant: isTravelingWithParticipant ); var instance = dependent.GetSevisExhangeVisitorDependentInstance(); Assert.IsInstanceOfType(instance, typeof(SEVISEVBatchTypeExchangeVisitorDependentEdit)); var sevisModel = (SEVISEVBatchTypeExchangeVisitorDependentEdit)instance; Assert.IsFalse(sevisModel.BirthCountryReasonSpecified); }
public void TestIgnoreDependentValidation_DependentIsNotDeleted() { var personId = 100; var participantId = 200; var firstName = "first"; var lastName = "last"; var passport = "passport"; var preferred = "preferred"; var suffix = "Jr."; var fullName = new FullName(firstName, lastName, passport, preferred, suffix); var birthCity = "birth city"; var birthCountryCode = "CN"; var birthDate = DateTime.UtcNow; var citizenshipCountryCode = "FR"; var email = "*****@*****.**"; var gender = Gender.SEVIS_MALE_GENDER_CODE_VALUE; var permanentResidenceCountryCode = "MX"; var phone = "123-456-7890"; var mailAddress = new AddressDTO { AddressId = 1, Country = LocationServiceAddressValidator.UNITED_STATES_COUNTRY_NAME }; var usAddress = new AddressDTO { AddressId = 2, Country = LocationServiceAddressValidator.UNITED_STATES_COUNTRY_NAME }; var printForm = true; var birthCountryReason = USBornReasonType.Item01.ToString(); var sevisId = "sevis id"; var remarks = "remarks"; string relationship = null; var isTravelingWithParticipant = true; var isDeleted = false; var dependent = new UpdatedDependent( fullName: fullName, birthCity: birthCity, birthCountryCode: birthCountryCode, birthCountryReasonCode: birthCountryReason, birthDate: birthDate, citizenshipCountryCode: citizenshipCountryCode, emailAddress: email, gender: gender, permanentResidenceCountryCode: permanentResidenceCountryCode, phoneNumber: phone, relationship: relationship, mailAddress: mailAddress, usAddress: usAddress, printForm: printForm, sevisId: sevisId, remarks: remarks, participantId: participantId, personId: personId, isDeleted: isDeleted, isTravelingWithParticipant: isTravelingWithParticipant ); Assert.AreEqual(isDeleted, dependent.IgnoreDependentValidation()); }
public void TestConstructor() { var personId = 100; var participantId = 200; var firstName = "first"; var lastName = "last"; var passport = "passport"; var preferred = "preferred"; var suffix = "Jr."; var fullName = new FullName(firstName, lastName, passport, preferred, suffix); var birthCity = "birth city"; var birthCountryCode = "CN"; var birthDate = DateTime.UtcNow; var citizenshipCountryCode = "FR"; var email = "*****@*****.**"; var gender = Gender.SEVIS_MALE_GENDER_CODE_VALUE; var permanentResidenceCountryCode = "MX"; var phone = "123-456-7890"; var mailAddress = new AddressDTO { AddressId = 1, Country = LocationServiceAddressValidator.UNITED_STATES_COUNTRY_NAME }; var usAddress = new AddressDTO { AddressId = 2, Country = LocationServiceAddressValidator.UNITED_STATES_COUNTRY_NAME }; var printForm = true; var birthCountryReason = USBornReasonType.Item01.ToString(); var sevisId = "sevis id"; var remarks = "remarks"; var relationship = DependentCodeType.Item01.ToString(); var isTravelingWithParticipant = true; var isDeleted = true; var instance = new UpdatedDependent( fullName, birthCity, birthCountryCode, birthCountryReason, birthDate, citizenshipCountryCode, email, gender, permanentResidenceCountryCode, phone, relationship, mailAddress, usAddress, printForm, sevisId, remarks, personId, participantId, isTravelingWithParticipant, isDeleted ); Assert.AreEqual(personId, instance.PersonId); Assert.AreEqual(participantId, instance.ParticipantId); Assert.AreEqual(birthCity, instance.BirthCity); Assert.AreEqual(birthCountryCode, instance.BirthCountryCode); Assert.AreEqual(birthDate, instance.BirthDate); Assert.AreEqual(citizenshipCountryCode, instance.CitizenshipCountryCode); Assert.AreEqual(email, instance.EmailAddress); Assert.AreEqual(gender, instance.Gender); Assert.AreEqual(permanentResidenceCountryCode, instance.PermanentResidenceCountryCode); Assert.AreEqual(phone, instance.PhoneNumber); Assert.AreEqual(printForm, instance.PrintForm); Assert.AreEqual(birthCountryReason, instance.BirthCountryReasonCode); Assert.AreEqual(sevisId, instance.SevisId); Assert.AreEqual(remarks, instance.Remarks); Assert.AreEqual(relationship, instance.Relationship); Assert.AreEqual(isTravelingWithParticipant, instance.IsTravelingWithParticipant); Assert.AreEqual(isDeleted, instance.IsDeleted); Assert.IsTrue(Object.ReferenceEquals(fullName, instance.FullName)); Assert.IsTrue(Object.ReferenceEquals(mailAddress, instance.MailAddress)); Assert.IsTrue(Object.ReferenceEquals(usAddress, instance.USAddress)); }