public void ShouldPassAskChurchQuestions(bool memberus, bool otherchurch, bool nochurch)
        {
            var requestManager  = FakeRequestManager.Create();
            var controller      = new CmsWeb.Areas.OnlineReg.Controllers.OnlineRegController(requestManager);
            var routeDataValues = new Dictionary <string, string> {
                { "controller", "OnlineReg" }
            };

            controller.ControllerContext = ControllerTestUtils.FakeControllerContext(controller, routeDataValues);

            var FakeOrg = FakeOrganizationUtils.MakeFakeOrganization(requestManager);

            OrgId = FakeOrg.org.OrganizationId;

            var model = FakeOrganizationUtils.GetFakeOnlineRegModel(OrgId);

            model.List[0].memberus    = memberus;
            model.List[0].otherchurch = otherchurch;
            model.List[0].nochurch    = nochurch;
            model.List[0].paydeposit  = true;

            var resultSubmitQuestions      = controller.SubmitQuestions(0, model);
            var resultCompleteRegistration = controller.CompleteRegistration(model);

            Assert.NotNull(resultSubmitQuestions);
            Assert.NotNull(resultCompleteRegistration);
            FakeOrganizationUtils.DeleteOrg(OrgId);
        }
Beispiel #2
0
        public void InvolvementList_Should_Have_FamilyId()
        {
            var requestManager  = FakeRequestManager.Create();
            var db              = requestManager.CurrentDatabase;
            var controller      = new CmsWeb.Areas.OnlineReg.Controllers.OnlineRegController(requestManager);
            var routeDataValues = new Dictionary <string, string> {
                { "controller", "OnlineReg" }
            };

            controller.ControllerContext = ControllerTestUtils.FakeControllerContext(controller, routeDataValues);

            var m       = OrganizationModel.Create(db, requestManager.CurrentUser);
            var FakeOrg = FakeOrganizationUtils.MakeFakeOrganization(requestManager);
            var model   = FakeOrganizationUtils.GetFakeOnlineRegModel(FakeOrg.org.OrganizationId);

            m.OrgId = FakeOrg.org.OrganizationId;

            var resultSubmitQuestions      = controller.SubmitQuestions(0, model);
            var resultCompleteRegistration = controller.CompleteRegistration(model);

            var TestInvolvementList = ExportInvolvements.InvolvementList(m.QueryId);
            var pkg = typeof(EpplusResult).GetField("pkg", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(TestInvolvementList);

            using (ExcelPackage package = (ExcelPackage)pkg)
            {
                ExcelWorksheet worksheet = package.Workbook.Worksheets[1];

                object[,] cellValues = (object[, ])worksheet.Cells.Value;
                List <string> ReportColumns = cellValues.Cast <object>().ToList().ConvertAll(x => Convert.ToString(x));
                var           FamilyId      = worksheet.Cells[1, 2].Value.ToString().Trim();

                ReportColumns.ShouldContain("FamilyId");
                FamilyId.ShouldBe("FamilyId");
            }
            FakeOrganizationUtils.DeleteOrg(FakeOrg.org.OrganizationId);
        }