Beispiel #1
0
        public void Should_be_possible_to_handle_execution_erros()
        {
            var prober = new UserProber();
            ProberBehaviorCreator.CreateBehaviorWithExceptionThrowing(prober);

            var probeResult = prober.Execute(FakeContext, FakeTargetInfo, FakeCollectInfo);

            DoAssertForExecutionWithErrors(probeResult, typeof(user_item));
        }
Beispiel #2
0
        public void Should_be_possible_to_call_UserProber_execution_without_erros()
        {
            var prober = new UserProber();
            ProberBehaviorCreator
                .CreateBehaviorForNormalFlowExecution(
                    prober,
                    new ItemType[] { new user_item() },
                    new CollectedItem[] { ProbeHelper.CreateFakeCollectedItem(new user_item()) });

            var probeResult = prober.Execute(FakeContext, FakeTargetInfo, FakeCollectInfo);

            DoAssertForSingleCollectedObject(probeResult, typeof(user_item));
        }
Beispiel #3
0
        public void Should_be_possible_to_collect_a_user_object_with_set()
        {
            var fakeUserObjectGuest = new UserObjectFactory().NewObject("Guest");
            var fakeUserObjectAdmin = new UserObjectFactory().NewObject("admin");
            var fakeUserObjectWithSet = new UserObjectFactory().NewObjectWithSet(fakeUserObjectGuest, fakeUserObjectAdmin);
            var fakeCollectInfo = ProbeHelper.CreateFakeCollectInfo(new Definitions.ObjectType[] { fakeUserObjectWithSet });
            var prober = new UserProber();
            ProberBehaviorCreator
                .CreateBehaviorForNormalFlowExecution(
                    prober,
                    new ItemType[] { new user_item() },
                    new CollectedItem[] { ProbeHelper.CreateFakeCollectedItem(new user_item()) });

            var probeResult = prober.Execute(FakeContext, FakeTargetInfo, fakeCollectInfo);

            Assert.IsNotNull(probeResult, "The result of probe execution cannot be null.");
            Assert.AreEqual(0, probeResult.CollectedObjects.Count(), "No items are expected");
        }