public void SetUp()
 {
     testDataHelper = new TestDataHelper();
     uploadFileRepository = new UploadFileRepository();
     constituent = testDataHelper.CreateConstituent(ConstituentMother.ConstituentWithName(ConstituentNameMother.JamesFranklin()));
     savedUpload = testDataHelper.CreateUpload(UploadMother.Test(constituent));
 }
        public void SetUp()
        {
            testDataHelper = new TestDataHelper();

            constituent = testDataHelper.CreateConstituent(ConstituentMother.ConstituentWithName(ConstituentNameMother.JamesFranklin()));
            savedAddress = testDataHelper.CreateAddress(AddressMother.SanFrancisco(constituent));
        }
        public static Occupation Doctor(Constituent constituent, Address address)
        {
            var doctor = Doctor(constituent);
            doctor.Address = address;

            return doctor;
        }
        public void ShouldRejectAConstituentIfNotApproved()
        {
            var mail = MockRepository.GenerateMock<IMail>();
            var repository = MockRepository.GenerateMock<IRegisterationRepository>();
            var constituentRepository = MockRepository.GenerateMock<IConstituentRepository>(null);
            var emailServiceImpl = MockRepository.GenerateMock<IEmailServiceImpl>();
            var  phoneServiceImpl = MockRepository.GenerateMock<IPhoneServiceImpl>();
            var  addressServiceImpl = MockRepository.GenerateMock<IAddressServiceImpl>();
            var loginServiceImpl = MockRepository.GenerateMock<ILoginServiceImpl>();

            var registrationServiceImpl = new RegistrationServiceImpl(repository, constituentRepository, mail, emailServiceImpl, phoneServiceImpl, addressServiceImpl, loginServiceImpl);

            var existingConstituent = new Constituent {Id = 11};
            var newConstituent = new Constituent {Id = 12};
            var email = new Email { Address = "*****@*****.**" };
            var rejectReason = "Reject";
            var adminEmail = "*****@*****.**";

            constituentRepository.Stub(repository1 => repository1.Load(11)).Return(existingConstituent);
            constituentRepository.Stub(repository1 => repository1.Load(12)).Return(newConstituent);
            constituentRepository.Stub(repository1 => repository1.Delete(newConstituent.Id));
            emailServiceImpl.Stub(impl => impl.FindEmails(newConstituent.Id.ToString())).Return(new List<Email> {email});

            registrationServiceImpl.RegisterConstituent(11,12,false,adminEmail, false, rejectReason);

            emailServiceImpl.AssertWasCalled(impl => impl.FindEmails(newConstituent.Id.ToString()));
            mail.AssertWasCalled(mail1 => mail1.Send(email.Address, "Kallivayalil Account Activation Failed.", string.Format(@"Dear Ma'am/Sir , {0} The request you placed to activate
                                        your Kallivayalil account has been reject by the admn team.
                                        {0} The reason is as follows : {1}{0} For any further queries
                                        contact the admin team.{0} Reagards,{0} Admin Team", "\n", rejectReason)));
            mail.AssertWasCalled(mail1 => mail1.Send(adminEmail, "Kallivayalil Account Registration Rejected.", string.Format(@"Account-{0} has been rejected. Reason : {1}", email.Address,rejectReason)));
        }
예제 #5
0
        public void SetUp()
        {
            testDataHelper = new TestDataHelper();

            savedConstituent = testDataHelper.CreateConstituent(ConstituentMother.ConstituentWithName(ConstituentNameMother.JamesFranklin()));
            testDataHelper.CreatePhone(PhoneMother.PrimaryMobile(savedConstituent));
        }
 private void LoadBranchType(Constituent constituent)
 {
     if (Entity.IsNull(constituent.BranchName))
     {
         throw new BadRequestException("AddressType can not be null");
     }
     constituent.BranchName = repository.Load<BranchType>(constituent.BranchName.Id);
 }
예제 #7
0
 public void Setup()
 {
     testDataHelper = new TestDataHelper();
     var constituentWithName = ConstituentMother.ConstituentWithName(ConstituentNameMother.AgnesAlba());
     constituentWithName.BranchName = BranchTypeMother.Anavalaril();
     constituentWithName.HouseName = "xyz";
     savedConstituent = testDataHelper.CreateConstituent(constituentWithName);
 }
 public void SetUp()
 {
     testDataHelper = new TestDataHelper();
     var constituent = ConstituentMother.ConstituentWithName(ConstituentNameMother.JamesFranklin());
     savedConstituent = testDataHelper.CreateConstituent(constituent);
     educationDetailRepository = new EducationDetailRepository(testDataHelper.session);
     savedEducationalDetail = testDataHelper.CreateEducationDetail(EducationDetailMother.School(savedConstituent));
 }
        public void SetUp()
        {
            testDataHelper = new TestDataHelper();

            constituent = testDataHelper.CreateConstituent(ConstituentMother.ConstituentWithName(ConstituentNameMother.JamesFranklin()));
            reciprocalConstituent = testDataHelper.CreateConstituent(ConstituentMother.ConstituentWithName(ConstituentNameMother.AgnesAlba()));
            savedAssociation = testDataHelper.CreateAssociation(AsociationMother.JamesFranklinAndJessicaAlba(constituent,reciprocalConstituent));
        }
 public void SetUp()
 {
     testDataHelper = new TestDataHelper();
     constituent = testDataHelper.CreateConstituent(ConstituentMother.ConstituentWithName(ConstituentNameMother.JamesFranklin()));
     testDataHelper.CreateConstituent(ConstituentMother.ConstituentWithName(ConstituentNameMother.AgnesAlba()));
     constituentData = new ConstituentData { Gender = "F", BornOn = DateTime.Now, BranchName = new BranchTypeData { Id = 1, Description = "Kallivayalil" }, MaritialStatus = 1 };
     constituentData.Name = new ConstituentNameData {FirstName = "James", LastName = "Franklin", Salutation = new SalutationTypeData {Id = 1, Description = "Mr"}};
 }
 public void SetUp()
 {
     testDataHelper = new TestDataHelper();
     committeeRepository = new CommitteeRepository(testDataHelper.session);
     var constituent = ConstituentMother.ConstituentWithName(ConstituentNameMother.JamesFranklin());
     savedConstituent = testDataHelper.CreateConstituent(constituent);
     savedCommittee = testDataHelper.CreateCommittee(CommitteeMother.President(savedConstituent));
 }
예제 #12
0
        public void SetUp()
        {
            testDataHelper = new TestDataHelper();

            constituent1 = testDataHelper.CreateConstituent(ConstituentMother.ConstituentWithName(ConstituentNameMother.JamesFranklin()));

            testDataHelper.CreateUpload(UploadMother.Test(constituent1));
        }
 public Constituent UpdateConstituent(string id, Constituent constituent)
 {
     if (repository.Exists<Constituent>(Convert.ToInt32(id)))
     {
         LoadBranchType(constituent);
         return repository.Update(constituent);
     }
     return null;
 }
 public static Association JamesFranklinAndParent(Constituent constituent)
 {
     return new Association()
                {
                    Type = AssociationTypeMother.Parent(),
                    Constituent = constituent,
                    AssociatedConstituentName = "Franklin",
                };
 }
        public void SetUp()
        {
            testDataHelper = new TestDataHelper();

            constituent = new Constituent {Gender = "M", BornOn = DateTime.Today, BranchName = BranchTypeMother.Kallivayalil(), MaritialStatus = 1, IsRegistered = 'N'};
            constituent.Name = ConstituentNameMother.JamesFranklin();

            registerationRepository = new RegisterationRepository();
        }
 public void SetUp()
 {
     testDataHelper = new TestDataHelper();
     var constituent = ConstituentMother.ConstituentWithName(ConstituentNameMother.JamesFranklin());
     savedConstituent = testDataHelper.CreateConstituent(constituent);
     savedAddress = testDataHelper.CreateAddress(AddressMother.SanFrancisco(savedConstituent));
     occupationRepository = new OccupationRepository(testDataHelper.session);
     savedOccupation = testDataHelper.CreateOccupation(OccupationMother.Doctor(savedConstituent, savedAddress));
 }
 public static AssociationData JamesAndJessica(Constituent constituent, Constituent associatedConstituent)
 {
     return new AssociationData()
                {
                    Type = new AssociationTypeData(){Description = "Spouse",Id=1},
                    AssociatedConstituent = new ConstituentData {Id= associatedConstituent.Id},
                    Constituent = new ConstituentData { Id = constituent.Id },
                };
 }
        public void SetUp()
        {
            testDataHelper = new TestDataHelper();
            var constituent = ConstituentMother.ConstituentWithName(ConstituentNameMother.JamesFranklin());
            savedConstituent = testDataHelper.CreateConstituent(constituent);
            savedAddress = testDataHelper.CreateAddress(AddressMother.SanFrancisco(savedConstituent));

            addressRepository = new AddressRepository(testDataHelper.session);
        }
 public static PhoneData Mobile(Constituent constituent, Address address)
 {
     return new PhoneData
                {
                    Type = new PhoneTypeData {Description = "Mobile", Id = 1},
                    Number = "9900012345",
                    Constituent = new LinkData {Id = constituent.Id},
                    Address = new ShortAddressData() {Id = address.Id}
                };
 }
        public void SetUp()
        {
            testDataHelper = new TestDataHelper();

            jamesFranklin = ConstituentMother.ConstituentWithName(ConstituentNameMother.JamesFranklin());
            savedConstituent = testDataHelper.CreateConstituent(jamesFranklin);

            savedEvent = testDataHelper.CreateEvent(EventMother.Anniversary());
            eventRepository = new EventRepository();
        }
 public static Association JamesFranklinAndJessicaAlba(Constituent constituent, Constituent associatedConstituent)
 {
     return new Association()
                {
                    Type = AssociationTypeMother.Spouse(),
                    Constituent = constituent,
                    StartDate = DateTime.Today,
                    AssociatedConstituent = associatedConstituent,
                };
 }
 public static OccupationData Doctor(Constituent constituent, Address address)
 {
     return new OccupationData
                {
                    Type = new OccupationTypeData {Description = "Primary", Id = 1},
                    OccupationName = "Doctor",
                    Description = "Senior Doctor",
                    Constituent = new LinkData {Id = constituent.Id},
                    Address = new LinkData {Id = address.Id}
                };
 }
 public static EducationDetail College(Constituent constituent)
 {
     return new EducationDetail
                {
                    Constituent = constituent,
                    Qualification = "Cse",
                    InstituteName = "PSG",
                    InstituteLocation = "CBE",
                    YearOfGraduation = "1995",
                    Type = EducationDetailTypeMother.University()
                };
 }
 public static EducationDetail School(Constituent constituent)
 {
     return new EducationDetail
                {
                    Constituent = constituent,
                    Qualification = "10th Grade",
                    InstituteName = "SHY",
                    InstituteLocation = "Yercaud",
                    YearOfGraduation = DateTime.Now.Date.ToShortDateString(),
                    Type = EducationDetailTypeMother.School()
                };
 }
 public static EducationDetailData School(Constituent constituent)
 {
     return new EducationDetailData
                {
                    Type = new EducationTypeData {Id = 1, Description = "School"},
                    Qualification = "12th grade",
                    InstituteName = "SHY",
                    InstituteLocation = "Yercaud",
                    YearOfGraduation = DateTime.Now.ToShortDateString(),
                    Constituent = new LinkData {Id = constituent.Id},
                };
 }
 public static AddressData SanFrancisco(Constituent constituent)
 {
     return new AddressData
                {
                    Line1 = "315 Montgomery Street",
                    City = "San Francisco",
                    State = "California",
                    PostCode = "ABCD",
                    Country = "USA",
                    Type = new AddressTypeData {Id = 1, Description = "Home"},
                    Constituent = new LinkData {Id = constituent.Id},
                };
 }
        public void SetUp()
        {
            testDataHelper = new TestDataHelper();
            var constituent = ConstituentMother.ConstituentWithName(ConstituentNameMother.JamesFranklin());
            savedConstituent = testDataHelper.CreateConstituent(constituent);

            constituent = ConstituentMother.ConstituentWithName(ConstituentNameMother.AgnesAlba());
            savedAssociatedConstituent = testDataHelper.CreateConstituent(constituent);

            savedAssociation = testDataHelper.CreateAssociation(AsociationMother.JamesFranklinAndParent(savedConstituent));

            associationRepository = new AssociationRepository(testDataHelper.session);
        }
예제 #28
0
 public static Address Texas(Constituent constituent)
 {
     return new Address
                {
                    Line1 = "1901 Bermondsey Street",
                    City = "Austin",
                    State = "Texas",
                    PostCode = "SE13 3TQ",
                    Country = "US",
                    Type = AddressTypeMother.Office(),
                    Constituent = constituent,
                };
 }
예제 #29
0
 public static Address SanFrancisco(Constituent constituent)
 {
     return new Address
                {
                    Line1 = "315 Montgomery Street",
                    City = "San Francisco",
                    State = "California",
                    PostCode = "ABCD",
                    Country = "USA",
                    Type = AddressTypeMother.Home(),
                    Constituent = constituent,
                };
 }
예제 #30
0
 public static Address London(Constituent constituent)
 {
     return new Address
                {
                    Line1 = "190 Bermondsey Street",
                    City = "London",
                    State = "London",
                    PostCode = "SE1 3TQ",
                    Country = "UK",
                    Type = AddressTypeMother.Office(),
                    Constituent = constituent,
                };
 }