@@ -11,6 +11,27 @@ public GivenThatWeWantToBuildANetCoreAppAndPassingALogger(ITestOutputHelper log)
11
11
{
12
12
}
13
13
14
+ private string CreateTargetFrameworkEvalTelemetryJson (
15
+ string targetFrameworkVersion ,
16
+ string targetPlatformIdentifier = "null" ,
17
+ string runtimeIdentifier = "null" ,
18
+ string selfContained = "null" ,
19
+ string useApphost = "null" ,
20
+ string outputType = "Library" ,
21
+ string useArtifactsOutput = "null" ,
22
+ string artifactsPathLocationType = "null" ,
23
+ string useMonoRuntime = "null" ,
24
+ string publishAot = "null" ,
25
+ string publishTrimmed = "null" ,
26
+ string publishSelfContained = "null" ,
27
+ string publishReadyToRun = "null" ,
28
+ string publishReadyToRunComposite = "false" ,
29
+ string publishProtocol = "null" ,
30
+ string configuration = "Debug" )
31
+ {
32
+ return $ "{{\" EventName\" :\" targetframeworkeval\" ,\" Properties\" :{{\" TargetFrameworkVersion\" :\" { targetFrameworkVersion } \" ,\" RuntimeIdentifier\" :\" { runtimeIdentifier } \" ,\" SelfContained\" :\" { selfContained } \" ,\" UseApphost\" :\" { useApphost } \" ,\" OutputType\" :\" { outputType } \" ,\" UseArtifactsOutput\" :\" { useArtifactsOutput } \" ,\" ArtifactsPathLocationType\" :\" { artifactsPathLocationType } \" ,\" TargetPlatformIdentifier\" :\" { targetPlatformIdentifier } \" ,\" UseMonoRuntime\" :\" { useMonoRuntime } \" ,\" PublishAot\" :\" { publishAot } \" ,\" PublishTrimmed\" :\" { publishTrimmed } \" ,\" PublishSelfContained\" :\" { publishSelfContained } \" ,\" PublishReadyToRun\" :\" { publishReadyToRun } \" ,\" PublishReadyToRunComposite\" :\" { publishReadyToRunComposite } \" ,\" PublishProtocol\" :\" { publishProtocol } \" ,\" Configuration\" :\" { configuration } \" }}";
33
+ }
34
+
14
35
[ CoreMSBuildOnlyFact ]
15
36
public void It_collects_TargetFramework_version_and_other_properties ( )
16
37
{
@@ -32,7 +53,8 @@ public void It_collects_TargetFramework_version_and_other_properties()
32
53
buildCommand
33
54
. Execute ( TelemetryTestLogger )
34
55
. StdOut . Should ( )
35
- . Contain ( $ "{{\" EventName\" :\" targetframeworkeval\" ,\" Properties\" :{{\" TargetFrameworkVersion\" :\" .NETCoreApp,Version=v{ ToolsetInfo . CurrentTargetFrameworkVersion } \" ,\" RuntimeIdentifier\" :\" null\" ,\" SelfContained\" :\" null\" ,\" UseApphost\" :\" null\" ,\" OutputType\" :\" Library\" ,\" UseArtifactsOutput\" :\" null\" ,\" ArtifactsPathLocationType\" :\" null\" }}") ;
56
+ . Contain ( CreateTargetFrameworkEvalTelemetryJson (
57
+ $ ".NETCoreApp,Version=v{ ToolsetInfo . CurrentTargetFrameworkVersion } ") ) ;
36
58
}
37
59
38
60
[ CoreMSBuildOnlyFact ]
@@ -59,11 +81,13 @@ public void It_collects_multi_TargetFramework_version_and_other_properties()
59
81
60
82
result
61
83
. StdOut . Should ( )
62
- . Contain (
63
- "{\" EventName\" :\" targetframeworkeval\" ,\" Properties\" :{\" TargetFrameworkVersion\" :\" .NETFramework,Version=v4.6\" ,\" RuntimeIdentifier\" :\" null\" ,\" SelfContained\" :\" null\" ,\" UseApphost\" :\" null\" ,\" OutputType\" :\" Library\" ,\" UseArtifactsOutput\" :\" null\" ,\" ArtifactsPathLocationType\" :\" null\" }" )
84
+ . Contain ( CreateTargetFrameworkEvalTelemetryJson (
85
+ ".NETFramework,Version=v4.6" ,
86
+ targetPlatformIdentifier : "Windows" ,
87
+ publishReadyToRunComposite : "null" ) )
64
88
. And
65
- . Contain (
66
- $ "{{ \" EventName \" : \" targetframeworkeval \" , \" Properties \" :{{ \" TargetFrameworkVersion \" : \" .NETCoreApp,Version=v{ ToolsetInfo . CurrentTargetFrameworkVersion } \" , \" RuntimeIdentifier \" : \" null \" , \" SelfContained \" : \" null \" , \" UseApphost \" : \" null \" , \" OutputType \" : \" Library \" , \" UseArtifactsOutput \" : \" null \" , \" ArtifactsPathLocationType \" : \" null \" }}" ) ;
89
+ . Contain ( CreateTargetFrameworkEvalTelemetryJson (
90
+ $ ".NETCoreApp,Version=v{ ToolsetInfo . CurrentTargetFrameworkVersion } " ) ) ;
67
91
}
68
92
}
69
93
}
0 commit comments