Beispiel #1
0
 private List <PegDetails> GetValidPegs(List <Peg> pegs, int?requireKeywords, string[] keywords,
                                        string[] penaltyKeywords, LinkedKeyword[] linkedKeywords, string receiverLocation)
 {
     return(pegs.Where(y => _pegHelper.IsPegValid(y.Comment, requireKeywords, keywords.Concat(linkedKeywords.Select(x => x.LinkedWord)).ToArray(), penaltyKeywords))
            .Select(y => new PegDetails
     {
         SenderName = y.Sender.Username,
         Weight = _pegHelper.GetPegWeighting(y.Sender.Location?.Location, receiverLocation),
         Comment = y.Comment,
         Keywords = GetPegKeywords(y.Comment, keywords, linkedKeywords),
         SenderLocation = y.Sender.Location?.Location
     })
            .ToList());
 }
Beispiel #2
0
 private void GivenPegWeighting()
 {
     _pegHelper.GetPegWeighting(Arg.Any <string>(), Arg.Any <string>()).Returns(x =>
                                                                                (string)x[0] == (string)x[1] ? 1 : 2);
 }