Esempio n. 1
0
        public IEnumerable<IFileResults> Run()
        {
            var results = new List<IFileResults>();

            var files = _fileRetriever.GetFiles();
            var rules = _ruleRetriever.GetRules();

            foreach (var file in files)
            {
                using (file)
                {
                    var fileResults = new FileResults(file);

                    foreach (var rule in rules)
                    {
                        var errors = rule.Check(file);
                        fileResults.Merge(errors);
                    }

                    results.Add(fileResults);
                }
            }

            return results;
        }
        public void SetUp()
        {
            _helper = new EnumerableHelper();
            _mocks = new MockRepository();

            _file = _mocks.Stub<IFile>();
            _fileResults = new FileResults(_file);
        }