Exemplo n.º 1
0
 public void Test_EventSource_Traits_Contract()
 {
     TestUtilities.CheckNoEventSourcesRunning("Start");
     using (var mySource = new ContractEventSourceWithTraits())
     {
         // By default we are self-describing.
         Assert.Equal(mySource.Settings, EventSourceSettings.EtwSelfDescribingEventFormat);
         Assert.Equal(mySource.GetTrait("MyTrait"), "MyTraitValue");
         Assert.Equal(mySource.GetTrait("ETW_GROUP"), "{4f50731a-89cf-4782-b3e0-dce8c90476ba}");
         Assert.Equal(mySource.GetTrait("ETW_2"), "#01 02 03 04");
         Assert.Equal(mySource.GetTrait("ETW_3"), "@Hello");
     }
     TestUtilities.CheckNoEventSourcesRunning("Stop");
 }
Exemplo n.º 2
0
 public void Test_EventSource_Traits_Contract()
 {
     TestUtilities.CheckNoEventSourcesRunning("Start");
     using (var mySource = new ContractEventSourceWithTraits())
     {
         // By default we are self-describing.  
         Assert.Equal(mySource.Settings, EventSourceSettings.EtwSelfDescribingEventFormat);
         Assert.Equal(mySource.GetTrait("MyTrait"), "MyTraitValue");
         Assert.Equal(mySource.GetTrait("ETW_GROUP"), "{4f50731a-89cf-4782-b3e0-dce8c90476ba}");
         Assert.Equal(mySource.GetTrait("ETW_2"), "#01 02 03 04");
         Assert.Equal(mySource.GetTrait("ETW_3"), "@Hello");
     }
     TestUtilities.CheckNoEventSourcesRunning("Stop");
 }