Esempio n. 1
0
        private static void RenderTranspharm(string id)
        {
            var generator = new ActionScheduleTranspharm.Generator();

            var report = new Report();

            var identity = new DummyIdentity();

            var client = id.Split('/')[0];

            var arguments = new List <ReportArgument>
            {
                new ReportArgument
                {
                    Name  = "id",
                    Value = id
                }
            };


            var context = new DefaultClientContext(string.Empty);

            var result = generator.Generate(report, context, identity, arguments);


            var rendered = RenderAsPdf("../../../Routing.ActionSchedule.Transpharm/" + client + ".rpt", result);

            File.WriteAllBytes("schedule." + client + ".pdf", rendered);
        }
Esempio n. 2
0
        public void Constructor_with_1_arg_puts_id_in_message()
        {
            var id = new DummyIdentity {
                Id = "A123"
            };
            var exception = new EntityNotFoundException(id);

            exception.Message.Should().Contain(id.HumanReadableId);
        }
Esempio n. 3
0
        public void Constructor_with_3_arg_puts_id_in_message()
        {
            var id = new DummyIdentity {
                Id = "A123"
            };
            var innerException = new KeyNotFoundException();
            var exception      = new EntityNotFoundException(id, "addendum", innerException);

            exception.Message.Should().Contain(id.HumanReadableId);
            exception.Message.Should().Contain("addendum");
            exception.InnerException.Should().Be(innerException);
        }