コード例 #1
0
        public void ReflectionRussianTest()
        {
            var       report = new CaseInvestigationReport();
            FieldInfo field  = typeof(CaseInvestigationReport).GetField("xrTableCell12",
                                                                        BindingFlags.NonPublic | BindingFlags.Instance);

            Assert.IsNotNull(field);
            var cell = (XRTableCell)field.GetValue(report);

            Assert.AreEqual("{0:dd/MM/yyyy}", cell.DataBindings[0].FormatString);

            var rebinder = new ReportRebinder(report, "ru");

            rebinder.RebindDateAndFontForReport();

            cell = (XRTableCell)field.GetValue(report);
            Assert.AreEqual("{0:dd.MM.yyyy}", cell.DataBindings[0].FormatString);
        }
コード例 #2
0
        public void TestCaseInvestigationWithStub()
        {
            var report = new CaseInvestigationReport();

            XRTableCell nameCell = GetCell(report, "xrTableCell21");

            Assert.AreEqual("CaseInvestigation.NameOfPatient", nameCell.DataBindings[0].DataMember);
            XRTableCell sexCell = GetCell(report, "xrTableCell27");

            Assert.AreEqual("CaseInvestigation.Sex", sexCell.DataBindings[0].DataMember);

            var rebinder = new AccessRigthsRebinder(report);

            rebinder.Process();

            Assert.AreEqual(0, nameCell.DataBindings.Count);
            Assert.AreEqual("*", nameCell.Text);
            Assert.AreEqual(1, sexCell.DataBindings.Count);
        }