public void WillFormatNameWithAppDomainNamePrefix() { AppDomainNameFormatter nameFormatter = new AppDomainNameFormatter(); string createdName = nameFormatter.CreateName("MyInstance"); Assert.IsTrue(createdName.EndsWith(" - MyInstance")); Assert.IsTrue(createdName.Length <= 128); }
public void WillFormatNameWithAppDomainNamePrefix() { AppDomainNameFormatter nameFormatter = new AppDomainNameFormatter(); string createdName = nameFormatter.CreateName("MyInstance"); Assert.IsTrue(createdName.EndsWith(" - MyInstance")); Assert.IsTrue(createdName.Length <= 128); }
public void SetUp() { formatter = new AppDomainNameFormatter(); formattedInstanceName = formatter.CreateName(instanceName); instrumentationProvider = new AuthorizationProviderInstrumentationProvider(); enabledInstrumentationListener = new AuthorizationProviderInstrumentationListener(instanceName, true, true, true, formatter); disabledInstrumentationListener = new AuthorizationProviderInstrumentationListener(instanceName, false, false, false, formatter); }
public void SetUp() { nameFormatter = new AppDomainNameFormatter(applicationInstanceName); instrumentationProvider = new HashAlgorithmInstrumentationProvider(instanceName, true, true, nameFormatter); formattedInstanceName = nameFormatter.CreateName(instanceName); totalHashComparisonPerformedPerformanceCounter = new EnterpriseLibraryPerformanceCounter(HashAlgorithmInstrumentationProvider.counterCategoryName, HashAlgorithmInstrumentationProvider.TotalHashComparisonPerformedPerformanceCounterName, formattedInstanceName); totalHashMismatchesPerformedPerformanceCounter = new EnterpriseLibraryPerformanceCounter(HashAlgorithmInstrumentationProvider.counterCategoryName, HashAlgorithmInstrumentationProvider.TotalHashMismatchesPerformedPerformanceCounterName, formattedInstanceName); totalHashOperationPerformedPerformanceCounter = new EnterpriseLibraryPerformanceCounter(HashAlgorithmInstrumentationProvider.counterCategoryName, HashAlgorithmInstrumentationProvider.TotalHashOperationPerformedPerformanceCounterName, formattedInstanceName); }
public void WillFormatNameUsingApplicationInstanceName() { string applicationInstanceName = "ApplicationInstanceName"; string suffix = "MySuffix"; string expectedInstanceName = string.Concat(applicationInstanceName, " - ", suffix); AppDomainNameFormatter formatter = new AppDomainNameFormatter(applicationInstanceName); string createdName = formatter.CreateName(suffix); Assert.AreEqual(expectedInstanceName, createdName); }
public void SetUp() { formatter = new AppDomainNameFormatter(); formattedInstanceName = formatter.CreateName(instanceName); enabledInstrumentationProvider = new SecurityCacheProviderInstrumentationProvider(instanceName, true, true, formatter); disabledInstrumentationProvider = new SecurityCacheProviderInstrumentationProvider(instanceName, false, false, formatter); totalSecurityCacheReadPerformedCounter = new EnterpriseLibraryPerformanceCounter(SecurityCacheProviderInstrumentationProvider.PerfomanceCountersCategoryName, SecurityCacheProviderInstrumentationProvider.TotalSecurityCacheReadPerformedCounterName, formattedInstanceName); ClearCounters(); }
public void SetUp() { formatter = new AppDomainNameFormatter(); formattedInstanceName = formatter.CreateName(instanceName); enabledInstrumentationProvider = new AuthorizationProviderInstrumentationProvider(instanceName, true, true, formatter); disabledInstrumentationProvider = new AuthorizationProviderInstrumentationProvider(instanceName, false, false, formatter); totalAuthorizationCheckFailedCounter = new EnterpriseLibraryPerformanceCounter(AuthorizationProviderInstrumentationProvider.PerformanceCountersCategoryName, AuthorizationProviderInstrumentationProvider.TotalAuthorizationCheckFailedCounterName, formattedInstanceName); totalAuthorizationCheckPerformedCounter = new EnterpriseLibraryPerformanceCounter(AuthorizationProviderInstrumentationProvider.PerformanceCountersCategoryName, AuthorizationProviderInstrumentationProvider.TotalAuthorizationCheckPerformedCounterName, formattedInstanceName); ClearCounters(); }
public void WillFormatNameUsingApplicationInstanceName() { string applicationInstanceName = "ApplicationInstanceName"; string suffix = "MySuffix"; string expectedInstanceName = string.Concat(applicationInstanceName, " - ", suffix); AppDomainNameFormatter formatter = new AppDomainNameFormatter(applicationInstanceName); string createdName = formatter.CreateName(suffix); Assert.AreEqual(expectedInstanceName, createdName); }
public void ShouldReplaceInvalidCharacters() { string invalidApplicationInstanceName = @"\\computer\object(parent/instance#index)\counter"; string validApplicationIntanceName = "computerobjectparentinstanceindexcounter"; validApplicationIntanceName = validApplicationIntanceName.Substring(0, 32); string suffix = "MySuffix"; string expectedInstanceName = string.Concat(validApplicationIntanceName, " - ", suffix); AppDomainNameFormatter formatter = new AppDomainNameFormatter(invalidApplicationInstanceName); string createdName = formatter.CreateName(suffix); Assert.AreEqual(expectedInstanceName, createdName); }
public void SetUp() { nameFormatter = new AppDomainNameFormatter(applicationInstanceName); instrumentationProvider = new SymmetricAlgorithmInstrumentationProvider(instanceName, true, true, nameFormatter); formattedInstanceName = nameFormatter.CreateName(instanceName); totalSymmetricDecryptionPerformedCounter = new EnterpriseLibraryPerformanceCounter(SymmetricAlgorithmInstrumentationProvider.counterCategoryName, SymmetricAlgorithmInstrumentationProvider.TotalSymmetricDecryptionPerformedCounterName, formattedInstanceName); totalSymmetricEncryptionPerformedCounter = new EnterpriseLibraryPerformanceCounter(SymmetricAlgorithmInstrumentationProvider.counterCategoryName, SymmetricAlgorithmInstrumentationProvider.TotalSymmetricEncryptionPerformedCounterName, formattedInstanceName); stream = CreateSymmetricKey(); provider = new SymmetricAlgorithmProvider(typeof(RijndaelManaged), stream, DataProtectionScope.CurrentUser, instrumentationProvider); totalSymmetricDecryptionPerformedCounter.Clear(); totalSymmetricEncryptionPerformedCounter.Clear(); }
public void SetUp() { nameFormatter = new AppDomainNameFormatter(applicationInstanceName); listener = new LoggingInstrumentationListener(instanceName, true, true, true, applicationInstanceName); tracerListener = new TracerInstrumentationListener(true); formattedInstanceName = nameFormatter.CreateName(instanceName); totalLoggingEventsRaised = new EnterpriseLibraryPerformanceCounter(counterCategoryName, TotalLoggingEventsRaised, formattedInstanceName); totalTraceListenerEntriesWritten = new EnterpriseLibraryPerformanceCounter(counterCategoryName, TotalTraceListenerEntriesWritten, formattedInstanceName); // Use AppDomainFriendlyName for the instance name nameFormatter = new AppDomainNameFormatter(); formattedInstanceName = nameFormatter.CreateName(instanceName); totalTraceOperationsStartedCounter = new EnterpriseLibraryPerformanceCounter(TracerInstrumentationListener.counterCategoryName, TracerInstrumentationListener.TotalTraceOperationsStartedCounterName, formattedInstanceName); }
public void ShouldReplaceInvalidCharacters() { string invalidApplicationInstanceName = @"\\computer\object(parent/instance#index)\counter"; string validApplicationIntanceName = "computerobjectparentinstanceindexcounter"; //Normalize string length validApplicationIntanceName = validApplicationIntanceName.Substring(0, 32); string suffix = "MySuffix"; string expectedInstanceName = string.Concat(validApplicationIntanceName, " - ", suffix); AppDomainNameFormatter formatter = new AppDomainNameFormatter(invalidApplicationInstanceName); string createdName = formatter.CreateName(suffix); Assert.AreEqual(expectedInstanceName, createdName); }