protected override void Given()
        {
            instance = MockRepository.GenerateStub<TestInterface>();

            instance.Expect(
                x => x.BeginMethod(
                        Arg<string>.Is.Anything,
                        Arg<AsyncCallback>.Is.Anything,
                        Arg<object>.Is.Anything))
                    .Return(null)
                    .WhenCalled(x => ((AsyncCallback)x.Arguments[1])(null));

            instance.Expect(x => x.EndMethod(null))
                    .Throw(exception);

            instance.Expect(
                x => x.BeginFunction(
                        Arg<string>.Is.Anything,
                        Arg<AsyncCallback>.Is.Anything,
                        Arg<object>.Is.Anything))
                    .Return(null)
                    .WhenCalled(x => ((AsyncCallback)x.Arguments[1])(null));

            instance.Expect(x => x.EndFunction(null))
                    .Throw(exception);

            command = new AsyncCommand(() => instance.Method(null), true);
            query = new AsyncQuery<string>(() => instance.Function(null), true);
        }
        protected override void Given()
        {
            instance = MockRepository.GenerateStrictMock<TestInterface>();
            ar = MockRepository.GenerateStub<IAsyncResult>();

            instance.Expect(
                x => x.BeginMethod(
                        Arg<string>.Is.Equal(parameter),
                        Arg<AsyncCallback>.Is.NotNull,
                        Arg<object>.Is.Null))
                    .Return(null)
                    .WhenCalled(x => ((AsyncCallback)x.Arguments[1])(ar));

            instance.Expect(x => x.EndMethod(ar));

            instance.Expect(
                x => x.BeginFunction(
                        Arg<string>.Is.Equal(parameter),
                        Arg<AsyncCallback>.Is.NotNull,
                        Arg<object>.Is.Null))
                    .Return(null)
                    .WhenCalled(x => ((AsyncCallback)x.Arguments[1])(ar));

            instance.Expect(x => x.EndFunction(ar)).Return(result);

            command = new AsyncCommand(() => instance.Method(parameter), true);
            query = new AsyncQuery<string>(() => instance.Function(parameter), true);
        }
        protected override void Given()
        {
            instance = MockRepository.GenerateStub<TestInterface>();

            instance.Expect(x => x.Method(null)).Throw(exception);
            instance.Expect(x => x.Function(null)).Throw(exception);

            command = new AsyncCommand(()=> instance.Method(null));
            query = new AsyncQuery<string>(()=> instance.Function(null));
        }
        protected override void Given()
        {
            instance = MockRepository.GenerateStrictMock<TestInterface>();

            instance.Expect(x => x.Method(parameter))
                    .WhenCalled(x => callThreadId = CurrentThreadId());

            instance.Expect(x => x.Function(parameter)).Return(result)
                    .WhenCalled(x => callThreadId = CurrentThreadId()); ;

            command = new AsyncCommand(()=> instance.Method(parameter));
            query = new AsyncQuery<string>(()=> instance.Function(parameter));
        }
Exemplo n.º 5
0
 public void TestResolver()
 {
     Resolver.GetConfigurator().Bind<ITestInterface<long>>().To<TestInterface<long>>().SetRequestResponseScope();
     Resolver.GetConfigurator().Bind<string>().To<string>().SetRequestResponseScope();
     Resolver.GetConfigurator().Bind<Int32>().To<Int32>().SetRequestResponseScope();
     ContainerFactory.Current.Bind(typeof(string),"test",Scope.Context);
     ContainerFactory.Current.Bind(typeof(Int32), 10, Scope.Context);
     var actual = Resolver.Activate<ITestInterface<long>>() as TestInterface<long>;
     var expected = new TestInterface<long>("test", 10);
     Assert.AreEqual(expected.Test, actual.Test);
     Assert.AreEqual(expected.Test2, actual.Test2);
 }
Exemplo n.º 6
0
 static void Main()
 {
     myInterface Interfaces = new TestInterface();
     Interfaces.Read();
 }
Exemplo n.º 7
0
 public static void OutputInterface(TestInterface ti)
 {
     ti.TestMethod();
 }
 public OurEventListener(TestInterface.Client client)
 {
     myClient = client;
 }
Exemplo n.º 9
0
 public void test_against_interface()
 {
     ti = new TestClass() { ID = 1 };
     var q = ctx.GetQuery<ObjectReferenceProperty>().Where(orp => orp.ID == ti.ID);
     foreach (var orp in q)
     {
         Assert.That(orp, Is.Not.Null);
     }
 }
Exemplo n.º 10
0
 public ClassWithInterfaceInConstructor(TestInterface member)
 {
     this.member = member;
 }
		public TestClassWithInterfaceDependencies(TestInterface dependency)
		{
			this.dependency = dependency;
		}
Exemplo n.º 12
0
        public void When(TestInterface arg)
        {

        }
Exemplo n.º 13
0
 public TestClass2(TestInterface face)
 {
 }