示例#1
0
 public void Setup()
 {
     fixture = new Fixture();
     fixture.Customize(new AutoMoqCustomization() { ConfigureMembers = true, GenerateDelegates = true });
     repository = fixture.Freeze<Mock<IGradeBookRepository>>();
     plagiarismService = fixture.Build<PlagiarismService>().OmitAutoProperties().Create();
 }
 public void Setup()
 {
     _settings = new PlagiarismSettings()
     {
         Threshold      = 0.6,
         Configurations = new List <ComparisonConfig>
         {
             new() { SamplingWindow = 6, KGramLength = 3 },
             new() { SamplingWindow = 8, KGramLength = 5 }
         }
     };
     _hashService        = new HashService();
     _plagiarismService  = new PlagiarismService(_settings, _hashService);
     _functionsToCompare = new List <FunctionAggregate>(new[]
     {
         GetFunctionAggregate(
             "var serviceProvider = new ServiceCollection().AddLogging().BuildServiceProvider();var factory = serviceProvider.GetService<ILoggerFactory>();"
             )
     });
     _suspectedFunction = GetFunctionAggregate(
         "var serviceProvider = new ServiceCollection().AddLogging().BuildServiceProvider();");
 }