示例#1
0
        public void Setup()
        {
            test_server = new Test();
            Bus.Session.Register(path, test_server);
            Assert.AreEqual(Bus.Session.RequestName(bus_name), RequestNameReply.PrimaryOwner);

            Assert.AreNotEqual(Bus.Session.RequestName(bus_name), RequestNameReply.PrimaryOwner);
            test = Bus.Session.GetObject <ITestOne> (bus_name, path);
        }
		public void Setup ()
		{
			test_server = new Test ();
			Bus.Session.Register (path, test_server);
			Assert.AreEqual (Bus.Session.RequestName (bus_name), RequestNameReply.PrimaryOwner);
			
			Assert.AreNotEqual (Bus.Session.RequestName (bus_name), RequestNameReply.PrimaryOwner);
			test = Bus.Session.GetObject<ITestOne> (bus_name, path);
		}
示例#3
0
        public void CreateObjectByAnotherInterfaceType()
        {
            //-- Act

            ITestOne one = m_FactoryUnderTest.CreateObject <ITestOne>();

            //-- Assert

            Assert.That(one, Is.Not.Null);
        }
示例#4
0
        public void ObjectInstancesAreAlwaysNew()
        {
            //-- Act

            ITestOne one1 = m_FactoryUnderTest.CreateObject <ITestOne>();
            ITestOne one2 = m_FactoryUnderTest.CreateObject <ITestOne>();

            //-- Assert

            Assert.That(one1, Is.Not.SameAs(one2));
        }
示例#5
0
        public void CacheAndReuseGeneratedTypes()
        {
            //-- Act

            ITestOne one1 = m_FactoryUnderTest.CreateObject <ITestOne>();
            ITestOne one2 = m_FactoryUnderTest.CreateObject <ITestOne>();

            //-- Assert

            Assert.That(one1.GetType(), Is.SameAs(one2.GetType()));
        }
示例#6
0
        public DemoController(ITestOne testOne, ITestTwo testTwo, ITestThree testThree
                              , ITestTransient testTransient, ITestScoped testScoped, ITestSingleton testSingleton, TestService testService
                              , IOptions <ConfigOptions> options
                              )
        {
            this._cfgContent = options.Value;

            _testOne   = testOne;
            _testTwo   = testTwo;
            _testThree = testThree;

            _testTransient = testTransient;
            _testScoped    = testScoped;
            _testSingleton = testSingleton;
            _testService   = testService;
        }
示例#7
0
 public MathOne(ITestOne testOne)
 {
     this.testOne = testOne;
 }
示例#8
0
 public AppPermission(ITestOne testOne)
 {
     testOne1 = testOne;
     testOne1.GoCome();
 }
示例#9
0
 public MathOne(ITestOne testOne)
 {
     _testOne = testOne;
 }