Esempio n. 1
0
        public void ShouldBuildAssociationWithoutParentAddressWhenParentLivesWithStudent()
        {
            var mapper = new CreateParentModelToStudentParentAssociationMapper(new CreateParentModelToParentMapper(), new CreateParentModelToParentAddressMapper());
            var parentEnrollmentInfoModel = MakeParentEnrollmentInfoModel(true);

            var studentParentAssociation = mapper.Build(parentEnrollmentInfoModel);

            studentParentAssociation.LivesWith.ShouldBe(true);
            CheckBasicParentInfo(studentParentAssociation);
        }
        public void ShouldBuildAssociationWithoutParentAddressWhenParentLivesWithStudent()
        {
            var mapper = new CreateParentModelToStudentParentAssociationMapper(new CreateParentModelToParentMapper(), new CreateParentModelToParentAddressMapper());
            var parentEnrollmentInfoModel = MakeParentEnrollmentInfoModel(true);

            var studentParentAssociation = mapper.Build(parentEnrollmentInfoModel);

            studentParentAssociation.LivesWith.ShouldBe(true);
            CheckBasicParentInfo(studentParentAssociation);
        }
        public void ShouldBuildAssociationWithParentAddressWhenAddressIsDifferentFromStudent()
        {
            var mapper = new CreateParentModelToStudentParentAssociationMapper(new CreateParentModelToParentMapper(), new CreateParentModelToParentAddressMapper());
            var parentEnrollmentInfoModel = MakeParentEnrollmentInfoModel(false);

            var studentParentAssociation = mapper.Build(parentEnrollmentInfoModel);
            
            studentParentAssociation.LivesWith.ShouldBe(false);
            var parent = studentParentAssociation.Parent;

            CheckBasicParentInfo(studentParentAssociation);

            var parentAddress = parent.ParentAddresses.First();
            parentAddress.City.ShouldBe("Durham");
            parentAddress.StateAbbreviationTypeId.ShouldBe((int)StateAbbreviationTypeEnum.NC);
            parentAddress.PostalCode.ShouldBe("70131");
            parentAddress.StreetNumberName.ShouldBe("1 Boak St");
            parentAddress.ApartmentRoomSuiteNumber.ShouldBe("1st flr");
        }
Esempio n. 4
0
        public void ShouldBuildAssociationWithParentAddressWhenAddressIsDifferentFromStudent()
        {
            var mapper = new CreateParentModelToStudentParentAssociationMapper(new CreateParentModelToParentMapper(), new CreateParentModelToParentAddressMapper());
            var parentEnrollmentInfoModel = MakeParentEnrollmentInfoModel(false);

            var studentParentAssociation = mapper.Build(parentEnrollmentInfoModel);

            studentParentAssociation.LivesWith.ShouldBe(false);
            var parent = studentParentAssociation.Parent;

            CheckBasicParentInfo(studentParentAssociation);

            var parentAddress = parent.ParentAddresses.First();

            parentAddress.City.ShouldBe("Durham");
            parentAddress.StateAbbreviationTypeId.ShouldBe((int)StateAbbreviationTypeEnum.NC);
            parentAddress.PostalCode.ShouldBe("70131");
            parentAddress.StreetNumberName.ShouldBe("1 Boak St");
            parentAddress.ApartmentRoomSuiteNumber.ShouldBe("1st flr");
        }