Ejemplo n.º 1
0
        public static void TestContractB_1(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 person = new PersonData {
                    ID = 10, FirstName = "Joe", LastName = "Tester"
                };

                cl.SetPersonOfTheDay(person);

                var ret = cl.GetPersonOfTheDay();

                Assert.AreEqual(10, ret.ID);
                Assert.AreEqual("Joe", ret.FirstName);
                Assert.AreEqual("Tester", ret.LastName);

                dumpBindingTransports(cl.Binding);
            }
        }
Ejemplo n.º 2
0
        public static void TestContractB_2(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 person = new PersonData{ID = 10, FirstName="Joe", LastName="Tester" };

                cl.SetPersonOfTheDay( person );

                var ret = cl.GetPersonOfTheDay();

                Assert.AreEqual( 10, ret.ID);
                Assert.AreEqual( "Joe", ret.FirstName);
                Assert.AreEqual( "Tester", ret.LastName);

                var sum = cl.SummarizeAndFinish(); //destructor

                Assert.AreEqual("That is all! for the person Tester", sum);

                cl.ForgetRemoteInstance();

                Assert.AreEqual("Felix", cl.GetName()); //this will allocate the new isntance

                sum = cl.SummarizeAndFinish(); // this will kill the instance again
                Assert.AreEqual("That is all! but no person of the day was set", sum);

                dumpBindingTransports( cl.Binding );
            }
        }
Ejemplo n.º 3
0
        public static void TestContractB_1_Async(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 person = new PersonData{ID = 10, FirstName="Joe", LastName="Tester" };

                var slot = cl.Async_SetPersonOfTheDay( person );

                slot.CheckVoidValue();

                slot = cl.Async_GetPersonOfTheDay();

                var ret = slot.GetValue<PersonData>();

                Assert.AreEqual( 10, ret.ID);
                Assert.AreEqual( "Joe", ret.FirstName);
                Assert.AreEqual( "Tester", ret.LastName);

                dumpBindingTransports( cl.Binding );
            }
        }
Ejemplo n.º 4
0
 public void SetPersonOfTheDay(PersonData person)
 {
     m_PersonOfTheDay = person;
 }
Ejemplo n.º 5
0
 public void SetPersonOfTheDay(PersonData person)
 {
     m_PersonOfTheDay = person;
 }