public void Should_be_possible_to_handle_error_during_prober_execution()
        {
            var prober = new FileEffectiveRights53Prober();

            new ProberBehaviorCreator().CreateBehaviorWithExceptionThrowing(prober);

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

            DoAssertForExecutionWithErrors(proberResult, typeof(fileeffectiverights_item));
        }
        public void If_any_occurs_while_item_type_creation_an_item_with_error_status_must_be_returned()
        {
            var prober = new FileEffectiveRights53Prober()
            {
                FileSystemDataSource = new FileObjectCollector(), FileProvider = new WindowsFileProvider(FakeTargetInfo)
            };

            CreateBehaviorWithExceptionThrowing(prober);

            var result = prober.Execute(FakeContext, FakeTargetInfo, GetFakeCollectInfo("1000"));

            DoAssertForExecutionWithErrors(result, typeof(fileeffectiverights_item));
        }
        public void Should_be_possible_to_call_FileEffectiveRights53Prober_execution_without_errors()
        {
            var prober = new FileEffectiveRights53Prober();

            new ProberBehaviorCreator()
            .CreateBehaviorForNormalFlowExecution(
                prober,
                FakeItemsToBeGenerateByItemTypeGenerator,
                FakeCollectedItemsToBeReturnedByObjectCollector);

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

            DoAssertForSingleCollectedObject(proberResult, typeof(fileeffectiverights_item));
        }
        public void Should_be_possible_to_use_SET_to_collect_fileeffectiverights53_object()
        {
            var objectWithSet   = OvalDefinitionsSample.objects.Single(obj => obj.id.Equals("oval:modulo:obj:1001"));
            var fakeCollectInfo = ProbeHelper.CreateFakeCollectInfo(new OVAL.Definitions.ObjectType[] { objectWithSet }, null, null);
            var prober          = new FileEffectiveRights53Prober();

            new ProberBehaviorCreator()
            .CreateBehaviorForNormalFlowExecution(
                prober,
                FakeItemsToBeGenerateByItemTypeGenerator,
                FakeCollectedItemsToBeReturnedByObjectCollector);


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

            Assert.AreEqual(0, proberResult.CollectedObjects.Count());
        }
        public void Should_be_possible_to_collect_a_FileEffectiveRights53Object()
        {
            #region
            //<fileeffectiverights53_object id="oval:modulo:obj:1000" version="1">
            //    <path>c:\temp</path>
            //    <filename>file1.txt</filename>
            //    <trustee_sid>S-1-15-18</trustee_sid>
            //</fileeffectiverights53_object>
            #endregion

            var prober = new FileEffectiveRights53Prober()
            {
                FileSystemDataSource = new FileObjectCollector(), FileProvider = new WindowsFileProvider(FakeTargetInfo)
            };
            CreateBehaviorForNormalFlowExecution(prober, FakeItemTypes, FakeCollectedItems);

            var result = prober.Execute(FakeContext, FakeTargetInfo, GetFakeCollectInfo("1000"));

            DoAssertForSingleCollectedObject(result, typeof(fileeffectiverights_item));
        }