public void WorkItemFiler_PerResultSplitStrategyPartitionsProperly()
        {
            SarifLog             sarifLog = TestData.CreateSimpleLog();
            SarifWorkItemContext context  = CreateAzureDevOpsTestContext();

            context.SplittingStrategy = SplittingStrategy.PerResult;

            int numberOfResults = sarifLog.Runs.Sum(run => run.Results.Count);

            context.SetProperty(ExpectedWorkItemsCount, numberOfResults);

            TestWorkItemFiler(sarifLog, context, true);
        }
        public void WorkItemFiler_PerRunSplitStrategyPartitionsProperlyGithub()
        {
            SarifWorkItemContext context = GitHubTestContext;

            SarifLog sarifLog = TestData.CreateSimpleLog();

            // Our default splitting strategy is PerRun, that is, one
            // work item (and corresponding attachment) should be filed
            // for each run in the log file.
            int numberOfRuns = sarifLog.Runs.Count;

            context.SetProperty(ExpectedWorkItemsCount, numberOfRuns);

            TestWorkItemFiler(sarifLog, context, false);
        }
        public void WorkItemFilingContext_RoundTripsWorkItemModelTransformer()
        {
            var munger = new Munger();

            var context = new SarifWorkItemContext();

            context.AddWorkItemModelTransformer(munger);
            context.Transformers[0].GetType().Should().Be(munger.GetType());

            context = RoundTripThroughXml(context);

            context.Transformers[0].GetType().Should().Be(munger.GetType());

            string newAreaPath = Guid.NewGuid().ToString();

            context.SetProperty(Munger.NewAreaPath, newAreaPath);

            var workItemModel = new SarifWorkItemModel(sarifLog: TestData.CreateSimpleLog(), context);

            context.Transformers[0].Transform(workItemModel);
            workItemModel.Area.Should().Be(newAreaPath);
        }