Beispiel #1
0
            public void ShouldWorkWithHeterogeneousSubscriptions()
            {
                ParseObject.RegisterSubclass <MockClassA>();
                ParseObject.RegisterSubclass <MockClassB>();

                ErrorCallback <MockClassA> errorCallback1 = Substitute.For <ErrorCallback <MockClassA> >();

                errorCallback1.When(x => x.Invoke(Arg.Any <ParseQuery <MockClassA> >(), Arg.Any <LiveQueryException>()))
                .Throw(c => c.ArgAt <LiveQueryException>(1));
                ErrorCallback <MockClassB> errorCallback2 = Substitute.For <ErrorCallback <MockClassB> >();

                errorCallback2.When(x => x.Invoke(Arg.Any <ParseQuery <MockClassB> >(), Arg.Any <LiveQueryException>()))
                .Throw(c => c.ArgAt <LiveQueryException>(1));

                ValidateReceivedEqualObjects(Event.Create, errorCallback1);
                ValidateReceivedEqualObjects(Event.Create, errorCallback2);
            }