Beispiel #1
0
 public bool CheckNeeds(INeedsChecker needsChecker, IPatchProgress progress)
 {
     if (needsChecker == null)
     {
         throw new ArgumentNullException(nameof(needsChecker));
     }
     if (progress == null)
     {
         throw new ArgumentNullException(nameof(progress));
     }
     return(true);
 }
        public PatchExtractorTest()
        {
            root = UrlBuilder.CreateRoot();
            file = UrlBuilder.CreateFile("abc/def.cfg", root);

            progress          = Substitute.For <IPatchProgress>();
            logger            = Substitute.For <IBasicLogger>();
            needsChecker      = Substitute.For <INeedsChecker>();
            tagListParser     = Substitute.For <ITagListParser>();
            protoPatchBuilder = Substitute.For <IProtoPatchBuilder>();
            patchCompiler     = Substitute.For <IPatchCompiler>();
            patchExtractor    = new PatchExtractor(progress, logger, needsChecker, tagListParser, protoPatchBuilder, patchCompiler);
        }
Beispiel #3
0
 public PatchExtractor(
     IPatchProgress progress,
     IBasicLogger logger,
     INeedsChecker needsChecker,
     ITagListParser tagListParser,
     IProtoPatchBuilder protoPatchBuilder,
     IPatchCompiler patchCompiler
     )
 {
     this.progress          = progress ?? throw new ArgumentNullException(nameof(progress));
     this.logger            = logger ?? throw new ArgumentNullException(nameof(logger));
     this.needsChecker      = needsChecker ?? throw new ArgumentNullException(nameof(needsChecker));
     this.tagListParser     = tagListParser ?? throw new ArgumentNullException(nameof(tagListParser));
     this.protoPatchBuilder = protoPatchBuilder ?? throw new ArgumentNullException(nameof(protoPatchBuilder));
     this.patchCompiler     = patchCompiler ?? throw new ArgumentNullException(nameof(patchCompiler));
 }
        public bool CheckNeeds(INeedsChecker needsChecker, IPatchProgress progress)
        {
            if (needsChecker == null)
            {
                throw new ArgumentNullException(nameof(needsChecker));
            }
            if (progress == null)
            {
                throw new ArgumentNullException(nameof(progress));
            }
            bool result = needsChecker.CheckNeeds(mod);

            if (!result)
            {
                progress.NeedsUnsatisfiedFor(urlConfig);
            }
            return(result);
        }
 public bool CheckNeeds(INeedsChecker needsChecker, IPatchProgress progress) => true;