예제 #1
0
파일: TestLogic.cs 프로젝트: filmor/nfx
        //this will throw
        public static void TestContractB_9(string CONF_SRC)
        {
            var conf = LaconicConfiguration.CreateFromString(CONF_SRC);

            using (var app = new ServiceBaseApplication(null, conf.Root))
            {
                var cl = new TestContractBClient(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;
                }
                Assert.IsNotNull(err);
                Assert.AreEqual(typeof(RemoteException), err.GetType());

                Assert.IsTrue(err.Message.Contains("MessageSizeException"));
                Assert.IsTrue(err.Message.Contains("exceeds limit"));
            }
        }
예제 #2
0
파일: TestLogic.cs 프로젝트: filmor/nfx
        public static void TestContractB_8(string CONF_SRC)
        {
            var conf = LaconicConfiguration.CreateFromString(CONF_SRC);

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

                var ret = cl.GetDailyStatuses(150);

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

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

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

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

                dumpBindingTransports(cl.Binding);
            }
        }
예제 #3
0
파일: TestLogic.cs 프로젝트: vlapchenko/nfx
        //this will throw
        public static void TestContractB_9(string CONF_SRC)
        {
            var conf = LaconicConfiguration.CreateFromString(CONF_SRC);
            using( var app = new ServiceBaseApplication(null, conf.Root))
            {
                var cl = new TestContractBClient(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;
                }
                Assert.IsNotNull( err );
                Assert.AreEqual( typeof(RemoteException), err.GetType());

                Assert.IsTrue( err.Message.Contains("MessageSizeException"));
                Assert.IsTrue( err.Message.Contains("exceeds limit"));
            }
        }
예제 #4
0
파일: TestLogic.cs 프로젝트: vlapchenko/nfx
        public static void TestContractB_8(string CONF_SRC)
        {
            var conf = LaconicConfiguration.CreateFromString(CONF_SRC);
            using( var app = new ServiceBaseApplication(null, conf.Root))
            {
                var cl = new TestContractBClient(App.ConfigRoot.AttrByName("cs").Value);

                var ret = cl.GetDailyStatuses(150);

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

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

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

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

                dumpBindingTransports( cl.Binding );
            }
        }