Exemplo n.º 1
0
 public TestDecorator7(Func <ITest1> test1)
 {
     this.Test = test1();
 }
Exemplo n.º 2
0
 public void Inject(ITest1 <I, K> test1)
 {
 }
Exemplo n.º 3
0
 public TestDecorator5(ITest1 test1)
 {
     this.Test = test1;
 }
Exemplo n.º 4
0
 public Test3(ITest1 test1)
 {
 }
Exemplo n.º 5
0
 public Test2(ITest1 test1)
 {
     Shield.EnsureNotNull(test1, nameof(test1));
     Shield.EnsureTypeOf<Test1>(test1);
 }
Exemplo n.º 6
0
 public Test3(ITest1 test1, ITest2 test2)
 {
 }
 public Test6(ITest1 test)
 {
     Count = 1;
 }
Exemplo n.º 8
0
 public ClassOne(ITest1 test1)
 {
     m_Itest1 = test1;
 }
Exemplo n.º 9
0
 public ClassTwo(ITest1 test1, One one)
 {
     m_Itest1 = test1;
     m_One = one;
 }
 public Test22([Dependency("test1")]ITest1 test1, [Dependency("test2")]ITest1 test2)
 {
     this.Test1 = test1;
     this.Test2 = test2;
 }
 public TestDecorator5(ITest1 test1)
 {
     this.Test = test1;
 }
Exemplo n.º 12
0
 public void Inject(ITest1 test)
 {
     Shield.EnsureNotNull(test, nameof(test));
     this.MethodInvoked = true;
     Name += test.Name;
 }
Exemplo n.º 13
0
 public Test3(ITest1 test1, ITest2 test2)
 {
     Name = test1.Name + test2.Name;
 }
Exemplo n.º 14
0
 public Test2(ITest1 test1)
 {
     this.Name = test1.Name;
 }
Exemplo n.º 15
0
 public TestDecorator9(ITest1 test1, IDecoratorDep dep)
 {
     this.Test = test1;
 }
Exemplo n.º 16
0
 public Test222(ITest1 test1)
 {
     Assert.Fail("Wrong constructor selected.");
 }
Exemplo n.º 17
0
 public TestDecorator12(ITest1 test1)
 {
     this.Test2 = ((T4)test1.Test).Test2;
 }
Exemplo n.º 18
0
 public Test2222(ITest1 test1)
 {
     Shield.EnsureNotNull(test1, nameof(test1));
     Shield.EnsureTypeOf <Test1>(test1);
 }
 // don't know what ctor to choose
 public Test5(ITest1 test)
 {
 }
Exemplo n.º 20
0
 public Test2222(ITest1 test1, [Dependency("test12")] ITest1 test2)
 {
     Assert.Fail("Wrong constructor selected.");
 }
Exemplo n.º 21
0
 public Test3([TestCondition2] ITest1 test12)
 {
     this.test12 = test12;
 }
Exemplo n.º 22
0
 public Test4(ITest1 test)
 {
     this.Test = test;
 }
Exemplo n.º 23
0
 public Test2(ITest1 test1)
 {
     this.Test1 = test1;
 }
Exemplo n.º 24
0
 public Test2([Dependency("test11")] ITest1 test1)
 {
     Shield.EnsureNotNull(test1, nameof(test1));
     Shield.EnsureTypeOf <Test11>(test1);
 }
Exemplo n.º 25
0
 public Test1(ITest1 <I, K> test1)
 {
 }
 public Test3(ITest1 test1, ITest2 test2)
 {
     this.Test1 = test1;
     this.Test2 = Test2;
 }
Exemplo n.º 27
0
 public TestDecorator1(ITest1 <T> test1)
 {
     this.Test = test1;
 }
Exemplo n.º 28
0
 public Test(ITest1 test1, ITest2 test2, ITest1 test3)
 {
     _test1 = test1;
 }
Exemplo n.º 29
0
 public TestDecorator6(Lazy <ITest1> test1)
 {
     this.Test = test1.Value;
 }
Exemplo n.º 30
0
        public void InterfaceIsGenerated()
        {
            var connection = Connection();

            // make sure that we can create an interface
            ITest1 i = connection.As <ITest1>();

            Assert.IsNotNull(i);

            // make sure that the wrapper is still a connection
            DbConnection c = i as DbConnection;

            Assert.IsNotNull(c);

            // let's call us some methods
            i.ExecuteSomething();
            i.ExecuteSomethingWithParameters(5, "6");
            Assert.AreEqual(9, i.ExecuteSomethingScalar(9));
            i.SingleObject().Verify(false);
            Assert.IsNull(i.SingleObjectWithNoData());
            Assert.AreEqual(2, i.QueryValue(9).Count());
            ParentTestData.Verify(i.QueryObject(), false);
            Assert.AreEqual(11, i.ObjectAsParameter(new ParentTestData()
            {
                ParentX = 11
            }));
            Assert.AreEqual(11, i.ObjectListAsParameter(new[] { new ParentTestData()
                                                                {
                                                                    ParentX = 11
                                                                } }).First());

            var results = i.QueryResults(7);

            ParentTestData.Verify(results.Set1, false);
            Assert.AreEqual(7, results.Set2.First());

            // let's call them asynchronously
            i.ExecuteSomethingAsync().Wait();
            i.ExecuteSomethingWithParametersAsync(5, "6").Wait();
            Assert.AreEqual(9, i.ExecuteSomethingScalarAsync(9).Result);
            i.SingleObjectAsync().Result.Verify(false);
            Assert.AreEqual(2, i.QueryValueAsync(9).Result.Count());
            ParentTestData.Verify(i.QueryObjectAsync().Result, false);
            Assert.AreEqual(11, i.ObjectAsParameterAsync(new ParentTestData()
            {
                ParentX = 11
            }).Result);
            Assert.AreEqual(11, i.ObjectListAsParameterAsync(new[] { new ParentTestData()
                                                                     {
                                                                         ParentX = 11
                                                                     } }).Result.First());

            results = i.QueryResultsAsync(7).Result;
            ParentTestData.Verify(results.Set1, false);
            Assert.AreEqual(7, results.Set2.First());

            // inline SQL!
            Assert.AreEqual("42", i.InlineSql(42));
            Assert.AreEqual(99, i.InlineSqlProcOverride(99));
            Assert.AreEqual(98, i.InlineSqlWithSchema(98));
            Assert.AreEqual(98, connection.As <ITestWithSqlAttribute>().ExecuteSomethingScalar(98));
        }
Exemplo n.º 31
0
 public TestDecorator8(IEnumerable <ITest1> test1)
 {
     this.Test = test1.First();
 }
Exemplo n.º 32
0
 public Test2(ITest1 test12)
 {
     this.test12 = test12;
 }
Exemplo n.º 33
0
 public TestDecorator10(ITest2 test2, ITest1 test1)
 {
     this.Test2 = test2;
     this.Test1 = test1;
 }
Exemplo n.º 34
0
 public Test2(ITest1 test1)
 {
     this.Name = test1.Name;
 }
Exemplo n.º 35
0
 public Test2(ITest1 test1)
 {
 }
Exemplo n.º 36
0
 public Test22([Dependency("test1")] ITest1 test1)
 {
     this.Name = test1.Name;
 }
Exemplo n.º 37
0
 public Test2(ITest1 test1)
 {
     this.Test1 = test1;
 }
Exemplo n.º 38
0
 public Test3(ITest1 test1, ITest2 test2)
 {
     Name = test1.Name + test2.Name;
 }
 // ctor to choose
 public Test6(ITest1 test1, ITest1 test2)
 {
     Count = 2;
 }
Exemplo n.º 40
0
 public void Inject(ITest1 test)
 {
     Shield.EnsureNotNull(test, nameof(test));
     this.MethodInvoked = true;
     Name += test.Name;
 }
Exemplo n.º 41
0
 public Test2(ITest1 test12)
 {
     this.test12 = test12;
 }
Exemplo n.º 42
0
 public Test3(ITest1 test1, ITest2 test2)
 {
 }
Exemplo n.º 43
0
 public Test2(ITest1 test1)
 {
 }
Exemplo n.º 44
0
 public Test2(ITest1 <I, K> test1, ITest1 <I, K> test2)
 {
     Test = test1;
 }
Exemplo n.º 45
0
 public Test33(ITest1 test1)
 {
     Shield.EnsureNotNull(test1, nameof(test1));
 }
Exemplo n.º 46
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);
            }
 public Test3(ITest1 test1, ITest2 test2)
 {
     _test1 = test1;
     _test2 = test2;
 }
Exemplo n.º 48
0
 public Test22(ITest1[] tests)
 {
     Shield.EnsureNotNull(tests, nameof(tests));
     Assert.AreEqual(3, tests.Count());
 }