コード例 #1
0
        //this will throw
        public static void TestContractB_9(string CONF_SRC)
        {
            var conf = LaconicConfiguration.CreateFromString(CONF_SRC);

            using (var app = new AzosApplication(null, conf.Root))
            {
                var cl = new TestContractBClient(app.Glue, app.ConfigRoot.AttrByName("cs").Value);

                Exception err = null;
                try
                {
                    cl.GetDailyStatuses(1); //this is needed to init type registry for sync binding
                                            //because otherwise it will abort the channel instead of marshalling exception back
                    cl.GetDailyStatuses(550);
                }
                catch (Exception error)
                {
                    err = error;
                }
                Aver.IsNotNull(err);
                Aver.AreObjectsEqual(typeof(RemoteException), err.GetType());

                Aver.IsTrue(err.Message.Contains("MessageSizeException"));
                Aver.IsTrue(err.Message.Contains("exceeds limit"));
            }
        }
コード例 #2
0
        public static void TestContractB_8(string CONF_SRC)
        {
            var conf = LaconicConfiguration.CreateFromString(CONF_SRC);

            using (var app = new AzosApplication(null, conf.Root))
            {
                var cl = new TestContractBClient(app.Glue, app.ConfigRoot.AttrByName("cs").Value);

                var ret = cl.GetDailyStatuses(150);

                Aver.AreEqual(150, ret.Count);
                var dt = new DateTime(1980, 1, 1);

                Aver.AreEqual(100, ret[dt].Count);
                Aver.AreEqual("Oleg0", ret[dt][0].FirstName);
                Aver.AreEqual("Oleg99", ret[dt][99].FirstName);
                Aver.AreEqual("Popov99", ret[dt][99].LastName);
                Aver.AreEqual(99000m, ret[dt][99].Salary);

                dt = dt.AddSeconds(ret.Count - 1);

                Aver.AreEqual(100, ret[dt].Count);
                Aver.AreEqual("Oleg0", ret[dt][0].FirstName);
                Aver.AreEqual("Oleg99", ret[dt][99].FirstName);
                Aver.AreEqual("Popov99", ret[dt][99].LastName);
                Aver.AreEqual(99000m, ret[dt][99].Salary);

                dumpBindingTransports(cl.Binding);
            }
        }