Ejemplo n.º 1
0
        public void ToPersonInfo_Empty_CorrectPersonTotal()
        {
            var personTotal = new PersonTotalStub();
            var personInfo  = personTotal.ToPersonInfo();

            Assert.AreEqual(personTotal, personInfo.PersonTotal);
        }
Ejemplo n.º 2
0
        public void ToPersonInfo_NoNationality_NoNationality()
        {
            var personTotal = new PersonTotalStub();
            var personInfo  = personTotal.ToPersonInfo();

            Assert.Null(personInfo.Nationality);
        }
Ejemplo n.º 3
0
        public void ToPersonInfo_NoAddress_NoAddress()
        {
            var personTotal = new PersonTotalStub();
            var personInfo  = personTotal.ToPersonInfo();

            Assert.Null(personInfo.Address);
        }
Ejemplo n.º 4
0
        public void ToPersonInfo_MixedNationalityWithAndWithoutEndDate_NoNationality(
            [ValueSource("RandomDecimalDates5")] decimal endDate,
            [Values(true, false)] bool reverse)
        {
            var personTotal            = new PersonTotalStub();
            var nationalityWithEndDate = new NationalityStub()
            {
                CorrectionMarker = null, NationalityEndDate = endDate
            };

            personTotal.Nationalities.Add(nationalityWithEndDate);
            var nationalityWithoutEndDate = new NationalityStub()
            {
                CorrectionMarker = null, NationalityEndDate = null
            };

            personTotal.Nationalities.Add(nationalityWithoutEndDate);
            if (reverse)
            {
                personTotal.Nationalities.Reverse();
            }
            var personInfo = personTotal.ToPersonInfo();

            Assert.AreEqual(nationalityWithoutEndDate, personInfo.Nationality);
        }
Ejemplo n.º 5
0
        public void ToPersonInfo_MixedAddressWithDifferentStartDatesDate_CorrectAddress(
            [ValueSource("RandomDecimalDates5")] decimal startDate,
            [Values(true, false)] bool reverse,
            [Values(true, false)] bool setEndDate)
        {
            var personTotal = new PersonTotalStub();
            var addressWithOlderStartDate = new PersonAddressStub()
            {
                CorrectionMarker = null, AddressStartDate = startDate - 1
            };

            personTotal.PersonAddresses.Add(addressWithOlderStartDate);
            var addressWithRecentStartDate = new PersonAddressStub()
            {
                CorrectionMarker = null, AddressStartDate = startDate
            };

            personTotal.PersonAddresses.Add(addressWithRecentStartDate);
            if (reverse)
            {
                personTotal.PersonAddresses.Reverse();
            }
            if (setEndDate)
            {
                addressWithOlderStartDate.AddressEndDate = addressWithOlderStartDate.AddressStartDate - 1;
            }
            var personInfo = personTotal.ToPersonInfo();

            Assert.AreEqual(addressWithRecentStartDate, personInfo.Address);
        }
Ejemplo n.º 6
0
        public void ToPersonInfo_ActiveNationality_CorrectNationality()
        {
            var personTotal = new PersonTotalStub();
            var nationality = new NationalityStub()
            {
                CorrectionMarker = null
            };

            personTotal.Nationalities.Add(nationality);
            var personInfo = personTotal.ToPersonInfo();

            Assert.AreEqual(nationality, personInfo.Nationality);
        }
Ejemplo n.º 7
0
        public void ToPersonInfo_ActiveAddress_CorrectAddress()
        {
            var personTotal   = new PersonTotalStub();
            var personAddress = new PersonAddressStub()
            {
                CorrectionMarker = null
            };

            personTotal.PersonAddresses.Add(personAddress);
            var personInfo = personTotal.ToPersonInfo();

            Assert.AreEqual(personAddress, personInfo.Address);
        }
Ejemplo n.º 8
0
        public void ToPersonInfo_NationalityWithEndDate_NoNationality(
            [ValueSource("RandomDecimalDates5")] decimal endDate)
        {
            var personTotal = new PersonTotalStub();
            var nationality = new NationalityStub()
            {
                CorrectionMarker = null, NationalityEndDate = endDate
            };

            personTotal.Nationalities.Add(nationality);
            var personInfo = personTotal.ToPersonInfo();

            Assert.Null(personInfo.Nationality);
        }
Ejemplo n.º 9
0
        public void ToPersonInfo_InActiveNationality_NoNationality(
            [Values('k', 'æ')] char correctionMarker)
        {
            var personTotal = new PersonTotalStub();
            var nationality = new NationalityStub()
            {
                CorrectionMarker = correctionMarker
            };

            personTotal.Nationalities.Add(nationality);
            var personInfo = personTotal.ToPersonInfo();

            Assert.Null(personInfo.Nationality);
        }
Ejemplo n.º 10
0
        public void ToPersonInfo_AddressWithEndDate_CorrectAddress(
            [ValueSource("RandomDecimalDates5")] decimal endDate)
        {
            var personTotal   = new PersonTotalStub();
            var personAddress = new PersonAddressStub()
            {
                CorrectionMarker = null, AddressEndDate = endDate
            };

            personTotal.PersonAddresses.Add(personAddress);
            var personInfo = personTotal.ToPersonInfo();

            Assert.AreEqual(personAddress, personInfo.Address);
        }
Ejemplo n.º 11
0
        public void ToPersonInfo_InActiveAddress_NoAddress(
            [Values('k', 'æ')] char correctionMarker)
        {
            var personTotal   = new PersonTotalStub();
            var personAddress = new PersonAddressStub()
            {
                CorrectionMarker = correctionMarker
            };

            personTotal.PersonAddresses.Add(personAddress);
            var personInfo = personTotal.ToPersonInfo();

            Assert.Null(personInfo.Address);
        }