File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
test/Microsoft.ComponentDetection.Contracts.Tests Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -204,4 +204,16 @@ public void TypedComponent_Serialization_LinuxComponent()
204204 linuxComponent . Name . Should ( ) . Be ( "SomeLinuxComponentName" ) ;
205205 linuxComponent . Version . Should ( ) . Be ( "SomeLinuxComponentVersion" ) ;
206206 }
207+
208+ [ TestMethod ]
209+ public void TypedComponent_Serialization_CppSdk ( )
210+ {
211+ TypedComponent tc = new CppSdkComponent ( "SomeCppSdk" , "1.2.3" ) ;
212+ var result = JsonSerializer . Serialize ( tc ) ;
213+ var deserializedTC = JsonSerializer . Deserialize < TypedComponent > ( result ) ;
214+ deserializedTC . Should ( ) . BeOfType ( typeof ( CppSdkComponent ) ) ;
215+ var cppSdkComponent = ( CppSdkComponent ) deserializedTC ;
216+ cppSdkComponent . Name . Should ( ) . Be ( "SomeCppSdk" ) ;
217+ cppSdkComponent . Version . Should ( ) . Be ( "1.2.3" ) ;
218+ }
207219}
You can’t perform that action at this time.
0 commit comments