public FileEffectiveRights53EntityOperationEvaluator( FileEffectiveRightsObjectCollector objectCollector, IFileProvider fileProvider) { this.FileEffectiveRights53SystemDataSource = objectCollector; this.FileProvider = fileProvider; this.PathOperatorEvaluator = new PathOperatorEvaluator(fileProvider, FamilyEnumeration.windows); }
private void checkPathOperatorInstance() { if (this.PathOperatorEvaluator == null) { var newPathOperator = new PathOperatorEvaluator(WindowsFileProvider, FamilyEnumeration.windows); this.PathOperatorEvaluator = newPathOperator; } }
public void Should_be_to_generate_xmlfilecontent_items_from_an_simple_object() { var fakeOvalObject = ProbeHelper.GetDefinitionObjectTypeByID("definitionsSimple", "2300"); var mocks = new MockRepository(); var fakeFileProvider = mocks.DynamicMock<IFileProvider>(); var pathOperator = new PathOperatorEvaluator(fakeFileProvider, FamilyEnumeration.windows); Expect.Call(fakeFileProvider.FileExists(null)).IgnoreArguments().Return(true); mocks.ReplayAll(); var itemsToCollect = new XmlFileContentItemTypeGenerator(pathOperator).GetItemsToCollect(fakeOvalObject, null).ToArray(); DoBasicAssert(itemsToCollect, 1, typeof(xmlfilecontent_item)); AssertXmlFileItem(itemsToCollect.Single(), @"c:\temp\definitions\bookstore.xml", @"//bookstore/book/title/text()"); }
private XmlFileContentItemTypeGenerator CreateMockedItemTypeGenerator( IList<String> fakeFilepaths, bool isForWindows = true) { MockRepository mocks = new MockRepository(); var fakeFileProvider = mocks.DynamicMock<IFileProvider>(); Expect.Call(fakeFileProvider.GetFileChildren(null)).IgnoreArguments().Return(fakeFilepaths); Expect.Call(fakeFileProvider.FileExists(null)).IgnoreArguments().Return(true); mocks.ReplayAll(); var targetFamily = isForWindows ? FamilyEnumeration.windows : FamilyEnumeration.unix; var pathOperator = new PathOperatorEvaluator(fakeFileProvider, targetFamily); return new XmlFileContentItemTypeGenerator(pathOperator); }
public void Should_be_to_generate_xmlfilecontent_items_from_an_object_with_referenced_variable_on_filepath_entity() { MockRepository mocks = new MockRepository(); var fakeFileProvider = mocks.DynamicMock<IFileProvider>(); Expect.Call(fakeFileProvider.FileExists(null)).IgnoreArguments().Return(true); var pathOperator = new PathOperatorEvaluator(fakeFileProvider, FamilyEnumeration.windows); var itemTypeGenerator = new XmlFileContentItemTypeGenerator(pathOperator); var expectedFilepath = @"c:\temp\definitions\bookstore.xml"; var fakeOvalObject = ProbeHelper.GetDefinitionObjectTypeByID("definitionsSimple", "2310"); var fakeEvaluatedVariables = VariableHelper.CreateVariableWithOneValue(fakeOvalObject.id, "oval:modulo:var:2310", expectedFilepath); mocks.ReplayAll(); var itemsToCollect = itemTypeGenerator.GetItemsToCollect(fakeOvalObject, fakeEvaluatedVariables); DoBasicAssert(itemsToCollect.ToArray(), 1, typeof(xmlfilecontent_item)); AssertXmlFileItem(itemsToCollect.Single(), expectedFilepath, "//bookstore/book/price/text()"); }
protected override void ConfigureObjectCollector() { if (base.ObjectCollector == null) { var newXPathOperator = new XPathOperator() { FileContentProvider = CustomFileProvider }; var objCollector = new XmlFileContentObjectCollector() { XPathOperator = newXPathOperator, Platform = this.Platform }; base.ObjectCollector = objCollector; } if (base.ItemTypeGenerator == null) { var pathOperatorEvaluator = new PathOperatorEvaluator(CustomFileProvider, Platform); var itemTypeGenerator = new XmlFileContentItemTypeGenerator(pathOperatorEvaluator); base.ItemTypeGenerator = itemTypeGenerator; } }
public XmlFileContentItemTypeGenerator(PathOperatorEvaluator poe) { this.PathOperatorEvaluator = poe; }
public FileContentEntityOperationEvaluator(BaseObjectCollector systemDataSource, IFileProvider fileProvider) { this.systemDataSource = systemDataSource; pathOperatorEvaluator = new PathOperatorEvaluator(fileProvider, FamilyEnumeration.windows); }
public FileEffectiveRightsOperationEvaluator(BaseObjectCollector sytemDataSource, IFileProvider fileProvider) { this.systemDataSource = sytemDataSource; this.pathOperatorEvaluator = new PathOperatorEvaluator(fileProvider, FamilyEnumeration.windows); }
public TextFileContentEntityOperationEvaluator(BaseObjectCollector systemDataSource, IFileProvider fileDataSource, FamilyEnumeration platform) { this.TextFileContentDataSource = systemDataSource; this.PathOperatorEvaluator = new PathOperatorEvaluator(fileDataSource, platform); }
public FileEntityOperationEvaluator(IFileProvider fileProvider, FamilyEnumeration platform) { this.FileProvider = fileProvider; this.pathOperatorEvaluator = new PathOperatorEvaluator(FileProvider, platform); }