Beispiel #1
0
        public void CheckProperties()
        {
            ITest2 proxy = (ITest2)XmlRpcProxyGen.Create(typeof(ITest2));
            X509CertificateCollection certs = proxy.ClientCertificates;
            string groupName = proxy.ConnectionGroupName;

#if (!FX1_0)
            bool expect100 = proxy.Expect100Continue;
#endif
            WebHeaderCollection header     = proxy.Headers;
            int  indentation               = proxy.Indentation;
            bool keepAlive                 = proxy.KeepAlive;
            XmlRpcNonStandard nonStandard  = proxy.NonStandard;
            bool                 preauth   = proxy.PreAuthenticate;
            Version              version   = proxy.ProtocolVersion;
            IWebProxy            webProxy  = proxy.Proxy;
            CookieContainer      container = proxy.CookieContainer;
            int                  timeout   = proxy.Timeout;
            string               url       = proxy.Url;
            bool                 useIndent = proxy.UseIndentation;
            System.Text.Encoding encoding  = proxy.XmlEncoding;
            string               method    = proxy.XmlRpcMethod;
            bool                 useIntTag = proxy.UseIntTag;

            // introspection methods
            try { proxy.SystemListMethods(); } catch (XmlRpcMissingUrl) { }
            try { proxy.SystemMethodSignature("Foo"); } catch (XmlRpcMissingUrl) { }
            try { proxy.SystemMethodHelp("Foo"); } catch (XmlRpcMissingUrl) { }
        }
        public async Task CallMeBack(ITest2 from)
        {
            Debug.WriteLine($"Test {Id} CallMeBack");
            await ResumeAsync("ThingPassed");

            Debug.WriteLine($"Test {Id} CallMeBack End");
        }
Beispiel #3
0
        public void TwoInterfacesOneInstance()
        {
            ITest1 test1 = _Test1.Global;
            ITest2 test2 = _Test2.Global;

            Assert.IsTrue(Object.ReferenceEquals(test1, test2));
        }
Beispiel #4
0
 public Test3(ITest1 test1, ITest2 test2)
 {
     Shield.EnsureNotNull(test1, nameof(test1));
     Shield.EnsureNotNull(test2, nameof(test2));
     Shield.EnsureTypeOf <Test1>(test1);
     Shield.EnsureTypeOf <Test2>(test2);
 }
Beispiel #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            ITest1 test1 = PMY.Remoting.Common.RemotingObjFactory.Test1;
            ITest2 test2 = PMY.Remoting.Common.RemotingObjFactory.Test2;

            MessageBox.Show(test1.Test());
            MessageBox.Show(test2.Test());
        }
Beispiel #6
0
            public Test3([Dependency("test12")] ITest1 test12, [Dependency("test2")] ITest2 test2)
            {
                Shield.EnsureNotNull(test12, nameof(test12));
                Shield.EnsureNotNull(test2, nameof(test2));

                Shield.EnsureTypeOf <Test12>(test12);
                Shield.EnsureTypeOf <Test2>(test2);
            }
 public void ConditionallyCallTest(ITest2 test, bool someLogic)
 {
     if (Common(someLogic))
     {
         return;
     }
     TestMethod(test);
 }
Beispiel #8
0
 static void Main(string[] args)
 {
     var dual = new Dual();
     ITest test = dual;
     test.Test();
     ITest2 test2 = dual;
     test2.Test();
     Console.ReadLine();
 }
Beispiel #9
0
        public void Method1Generic()
        {
            ITest2 proxy            = XmlRpcProxyGen.Create <ITest2>();
            XmlRpcClientProtocol cp = (XmlRpcClientProtocol)proxy;

            Assert.IsTrue(cp is ITest2);
            Assert.IsTrue(cp is IXmlRpcProxy);
            Assert.IsTrue(cp is XmlRpcClientProtocol);
        }
Beispiel #10
0
            public Test3(ITest1 test1, ITest2 test2)
            {
                Test1 = test1;
                Test2 = test2;
                Shield.EnsureNotNull(test1, nameof(test1));
                Shield.EnsureNotNull(test2, nameof(test2));
                Shield.EnsureNotNullOrEmpty(test1.Name, nameof(test1.Name));

                Shield.EnsureTypeOf <Test1>(test1);
                Shield.EnsureTypeOf <Test2>(test2);
            }
Beispiel #11
0
        public void InstanceTypeLifeCycle()
        {
            IContainer container = new IocContainer.Container();

            // testing instance type resigtration for class
            container.RegisterInstanceType <ITest2, ClassTest2>();

            ITest2 obj1 = container.Resolve <ITest2>();

            container.RegisterInstanceType <ITest2, ClassTest2>();
            ITest2 obj2 = container.Resolve <ITest2>();

            Assert.NotEqual(obj2.Hash(), obj1.Hash());
        }
Beispiel #12
0
        public void SingletonLifeCycle()
        {
            IContainer container = new IocContainer.Container();

            container.RegisterSingletonType <ITest2, ClassTest2>();

            ITest2 obj1 = container.Resolve <ITest2>();

            container.RegisterSingletonType <ITest2, ClassTest2>();

            ITest2 obj2 = container.Resolve <ITest2>();

            Assert.Equal(obj2.Hash(), obj1.Hash());
        }
Beispiel #13
0
        static void Main(string[] args)
        {
            Program obj = new Program();

            obj.Add(10, 15);
            obj.Sub(10, 5);
            ITest1 i1 = obj;
            ITest2 i2 = obj;

            i1.Show();
            i2.Show();
            // Calling Show() method from object reference
            Console.WriteLine("Hello World!");
        }
Beispiel #14
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            ContainerBuilder builder = new ContainerBuilder();

            builder.RegisterType <Test>().As <ITest1>().InstancePerLifetimeScope();
            builder.RegisterType <Test2>().As <ITest2>().InstancePerLifetimeScope();
            var container = builder.Build();

            //       ITest1 t = container.Resolve<ITest1>();
            Console.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            ITest2 t2 = container.Resolve <ITest2>();

            Console.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            t2.Test();
            Console.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            Console.Read();
        }
Beispiel #15
0
        static void Main(string[] args)
        {
            TestClass test = new TestClass();

            Console.WriteLine(test.GetMenu());

            ITest1 test1 = test;
            ITest2 test2 = test;

            Console.WriteLine(test1.GetMenu());
            Console.WriteLine(test2.GetMenu());
            Console.ReadKey();

            //Student student1 = new Student() { Age = 20, Name = "Alex" };
            //Student student2 = new Student() { Age = 18, Name = "Katua" };
            //Student[] arrayStudent = { student1, student2 };

            //Array.Sort(arrayStudent);
        }
Beispiel #16
0
            public Test3(ITest1 test1, ITest2 test2)
            {
                Shield.EnsureNotNull(test1, nameof(test1));
                Shield.EnsureNotNull(test2, nameof(test2));
                Shield.EnsureNotNullOrEmpty(test1.Name, nameof(test1.Name));

                Shield.EnsureTypeOf<Test1>(test1);
                Shield.EnsureTypeOf<Test2>(test2);
            }
Beispiel #17
0
 public Test3(ITest1 test1, ITest2 test2)
 {
 }
Beispiel #18
0
 public void PrintFruits2(ITest2 <Apple> test)
 {
     test.SetValue(new Apple());
 }
Beispiel #19
0
 public Test3(ITest1 test1, ITest2 test2)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ImpTest3"/> class.
 /// </summary>
 /// <param name="impTest2">The imp test2.</param>
 public ImpTest3(ITest2 impTest2)
 {
     this.impTest2 = impTest2;
 }
 public Test1(ITest2 test2)
 {
     Test2 = test2;
 }
 public Test3(ITest1 test1, ITest2 test2)
 {
     this.Test1 = test1;
     this.Test2 = Test2;
 }
 public Test1(ITest test, ITest2 test2, int test3)
 {
 }
Beispiel #24
0
 public Test3(ITest1 test1, ITest2 test2)
 {
     Name = test1.Name + test2.Name;
 }
 public Test1(ITest test, ITest2 test2, ITest3 test3)
 {
 }
 // correct ctor to choose
 public TestController1(ITest1 test1, ITest2 test2)
 {
     Count = 2;
     Test1 = test1;
     Test2 = test2;
 }
Beispiel #27
0
 public Test3(ITest1 test1, ITest2 test2)
 {
     Name = test1.Name + test2.Name;
 }
Beispiel #28
0
 public ClassTest(ITest1 t1, ITest2 t2, ITest3 t3)
 {
 }
Beispiel #29
0
 public void Process(ITest2 test)
 {
     test.Counter();
     Counter();
 }
 public Test3(ITest1 test1, ITest2 test2)
 {
     _test1 = test1;
     _test2 = test2;
 }
 public Test1(ITest test, ITest2 test2)
 {
 }
Beispiel #32
0
 public Test(ITest2 test2)
 {
     this.test2 = test2;
 }
 /// <summary>
 /// Second overload
 /// </summary>
 /// <param name="test2"></param>
 public void TestMethod(ITest2 test2)
 {
 }
 public Test3(ITest1 test1, ITest2 test2)
 {
     _test1 = test1;
     _test2 = test2;
 }
Beispiel #35
0
 public void MethodInInjection(ITest2 t2, int a)
 {
     t2.Say();
 }