Skip to content

Commit

Permalink
update metrics tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cslong committed Jun 28, 2022
1 parent 9808daa commit 9efb63c
Showing 1 changed file with 29 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ public void GenerateAnalysisReport()
var expectedAnalysisReport = @"[
{
""metricsType"": ""CTA"",
""language"": ""csharp"",
""metricName"": ""UpgradePackage"",
""packageName"": ""Newtonsoft.Json"",
""packageVersion"": ""12.0.0"",
Expand All @@ -196,35 +197,37 @@ public void GenerateAnalysisReport()
},
{
""metricsType"": ""CTA"",
""language"": ""csharp"",
""metricName"": ""GenericAction"",
""actionName"": ""GA1 Name"",
""actionType"": ""GA1 Type"",
""actionValue"": ""GA1 Value"",
""solutionPath"": ""5fa9de0cb5af2d468dfb1702b1e342f47de2df9a195dabb3be2d04f9c2767482"",
""projectGuid"": ""1234-5678"",
""filePath"": ""eb98c1d648bc61064bdeaca9523a49e51bb3312f28f59376fb385e1569c77822"",
""language"": ""csharp""
""filePath"": ""eb98c1d648bc61064bdeaca9523a49e51bb3312f28f59376fb385e1569c77822""
},
{
""metricsType"": ""CTA"",
""language"": ""csharp"",
""metricName"": ""GenericAction"",
""actionName"": ""GA2 Name"",
""actionType"": ""GA2 Type"",
""actionValue"": ""GA2 Value"",
""solutionPath"": ""5fa9de0cb5af2d468dfb1702b1e342f47de2df9a195dabb3be2d04f9c2767482"",
""projectGuid"": ""1234-5678"",
""filePath"": ""eb98c1d648bc61064bdeaca9523a49e51bb3312f28f59376fb385e1569c77822"",
""language"": ""csharp""
""filePath"": ""eb98c1d648bc61064bdeaca9523a49e51bb3312f28f59376fb385e1569c77822""
},
{
""metricsType"": ""CTA"",
""language"": ""csharp"",
""metricName"": ""MissingMetaReference"",
""metaReference"": ""C://reference1.dll"",
""solutionPath"": ""5fa9de0cb5af2d468dfb1702b1e342f47de2df9a195dabb3be2d04f9c2767482"",
""projectGuid"": ""1234-5678""
},
{
""metricsType"": ""CTA"",
""language"": ""csharp"",
""metricName"": ""MissingMetaReference"",
""metaReference"": ""C://reference2.dll"",
""solutionPath"": ""5fa9de0cb5af2d468dfb1702b1e342f47de2df9a195dabb3be2d04f9c2767482"",
Expand All @@ -241,6 +244,7 @@ public void GenerateAnalysisReportWithFeatureDetection()
var expectedAnalysisReport = @"[
{
""metricsType"": ""CTA"",
""language"": ""csharp"",
""metricName"": ""UpgradePackage"",
""packageName"": ""Newtonsoft.Json"",
""packageVersion"": ""12.0.0"",
Expand All @@ -250,49 +254,53 @@ public void GenerateAnalysisReportWithFeatureDetection()
},
{
""metricsType"": ""CTA"",
""language"": ""csharp"",
""metricName"": ""GenericAction"",
""actionName"": ""GA1 Name"",
""actionType"": ""GA1 Type"",
""actionValue"": ""GA1 Value"",
""solutionPath"": ""5fa9de0cb5af2d468dfb1702b1e342f47de2df9a195dabb3be2d04f9c2767482"",
""projectGuid"": ""1234-5678"",
""filePath"": ""eb98c1d648bc61064bdeaca9523a49e51bb3312f28f59376fb385e1569c77822"",
""language"": ""csharp""
""filePath"": ""eb98c1d648bc61064bdeaca9523a49e51bb3312f28f59376fb385e1569c77822""
},
{
""metricsType"": ""CTA"",
""language"": ""csharp"",
""metricName"": ""GenericAction"",
""actionName"": ""GA2 Name"",
""actionType"": ""GA2 Type"",
""actionValue"": ""GA2 Value"",
""solutionPath"": ""5fa9de0cb5af2d468dfb1702b1e342f47de2df9a195dabb3be2d04f9c2767482"",
""projectGuid"": ""1234-5678"",
""filePath"": ""eb98c1d648bc61064bdeaca9523a49e51bb3312f28f59376fb385e1569c77822"",
""language"": ""csharp""
""filePath"": ""eb98c1d648bc61064bdeaca9523a49e51bb3312f28f59376fb385e1569c77822""
},
{
""metricsType"": ""CTA"",
""language"": ""csharp"",
""metricName"": ""DetectedFeature"",
""featureName"": ""Feature 1"",
""solutionPath"": ""5fa9de0cb5af2d468dfb1702b1e342f47de2df9a195dabb3be2d04f9c2767482"",
""projectGuid"": ""1234-5678""
},
{
""metricsType"": ""CTA"",
""language"": ""csharp"",
""metricName"": ""DetectedFeature"",
""featureName"": ""Feature 1a"",
""solutionPath"": ""5fa9de0cb5af2d468dfb1702b1e342f47de2df9a195dabb3be2d04f9c2767482"",
""projectGuid"": ""1234-5678""
},
{
""metricsType"": ""CTA"",
""language"": ""csharp"",
""metricName"": ""MissingMetaReference"",
""metaReference"": ""C://reference1.dll"",
""solutionPath"": ""5fa9de0cb5af2d468dfb1702b1e342f47de2df9a195dabb3be2d04f9c2767482"",
""projectGuid"": ""1234-5678""
},
{
""metricsType"": ""CTA"",
""language"": ""csharp"",
""metricName"": ""MissingMetaReference"",
""metaReference"": ""C://reference2.dll"",
""solutionPath"": ""5fa9de0cb5af2d468dfb1702b1e342f47de2df9a195dabb3be2d04f9c2767482"",
Expand Down Expand Up @@ -389,24 +397,28 @@ public void GenerateAndExportReports_Creates_Expected_Json_Report()
var expectedJsonReport = @"[
{
""metricsType"": ""CTA"",
""language"": null,
""metricName"": ""Namespace"",
""reference"": ""System.Web"",
""solutionPath"": ""5fa9de0cb5af2d468dfb1702b1e342f47de2df9a195dabb3be2d04f9c2767482""
},
{
""metricsType"": ""CTA"",
""language"": null,
""metricName"": ""Namespace"",
""reference"": ""System.Web.Mvc"",
""solutionPath"": ""5fa9de0cb5af2d468dfb1702b1e342f47de2df9a195dabb3be2d04f9c2767482""
},
{
""metricsType"": ""CTA"",
""language"": null,
""metricName"": ""RulesFile"",
""downloadedFile"": ""project.all.json"",
""solutionPath"": ""5fa9de0cb5af2d468dfb1702b1e342f47de2df9a195dabb3be2d04f9c2767482""
},
{
""metricsType"": ""CTA"",
""language"": ""csharp"",
""metricName"": ""TargetVersion"",
""targetVersion"": ""netcoreapp3.1"",
""sourceVersion"": ""net48"",
Expand All @@ -415,6 +427,7 @@ public void GenerateAndExportReports_Creates_Expected_Json_Report()
},
{
""metricsType"": ""CTA"",
""language"": ""csharp"",
""metricName"": ""UpgradePackage"",
""packageName"": ""Newtonsoft.Json"",
""packageVersion"": ""12.0.0"",
Expand All @@ -424,6 +437,7 @@ public void GenerateAndExportReports_Creates_Expected_Json_Report()
},
{
""metricsType"": ""CTA"",
""language"": ""csharp"",
""metricName"": ""ActionExecution"",
""actionName"": ""GA1 Name"",
""actionType"": ""GA1 Type"",
Expand All @@ -436,6 +450,7 @@ public void GenerateAndExportReports_Creates_Expected_Json_Report()
},
{
""metricsType"": ""CTA"",
""language"": ""csharp"",
""metricName"": ""ActionExecution"",
""actionName"": ""GA2 Name"",
""actionType"": ""GA2 Type"",
Expand All @@ -448,6 +463,7 @@ public void GenerateAndExportReports_Creates_Expected_Json_Report()
},
{
""metricsType"": ""CTA"",
""language"": ""csharp"",
""metricName"": ""BuildError"",
""buildErrorCode"": ""CS0000"",
""buildError"": ""CS0000: BuildError1"",
Expand All @@ -457,6 +473,7 @@ public void GenerateAndExportReports_Creates_Expected_Json_Report()
},
{
""metricsType"": ""CTA"",
""language"": ""csharp"",
""metricName"": ""BuildError"",
""buildErrorCode"": ""OTHER"",
""buildError"": ""BuildError2"",
Expand All @@ -466,6 +483,7 @@ public void GenerateAndExportReports_Creates_Expected_Json_Report()
},
{
""metricsType"": ""CTA"",
""language"": ""unknown"",
""metricName"": ""BuildError"",
""buildErrorCode"": ""OTHER"",
""buildError"": ""BuildError3"",
Expand All @@ -475,6 +493,7 @@ public void GenerateAndExportReports_Creates_Expected_Json_Report()
},
{
""metricsType"": ""CTA"",
""language"": ""unknown"",
""metricName"": ""BuildError"",
""buildErrorCode"": ""OTHER"",
""buildError"": ""BuildError4"",
Expand All @@ -484,13 +503,15 @@ public void GenerateAndExportReports_Creates_Expected_Json_Report()
},
{
""metricsType"": ""CTA"",
""language"": ""csharp"",
""metricName"": ""MissingMetaReference"",
""metaReference"": ""C://reference1.dll"",
""solutionPath"": ""5fa9de0cb5af2d468dfb1702b1e342f47de2df9a195dabb3be2d04f9c2767482"",
""projectGuid"": ""1234-5678""
},
{
""metricsType"": ""CTA"",
""language"": ""csharp"",
""metricName"": ""MissingMetaReference"",
""metaReference"": ""C://reference2.dll"",
""solutionPath"": ""5fa9de0cb5af2d468dfb1702b1e342f47de2df9a195dabb3be2d04f9c2767482"",
Expand Down

0 comments on commit 9efb63c

Please sign in to comment.