From 340f05aef4b58242a8a6c0d4c83f37b7c99d5a18 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Wed, 25 Jan 2012 17:52:47 -0800 Subject: [PATCH] Fixed broken tests, DeskMetrics now has a different id during dev and production. --- NzbDrone.Core.Test/ProviderTests/ConfigProviderTest.cs | 5 +---- NzbDrone.Core/CentralDispatch.cs | 6 +++++- NzbDrone.Core/Providers/AnalyticsProvider.cs | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/NzbDrone.Core.Test/ProviderTests/ConfigProviderTest.cs b/NzbDrone.Core.Test/ProviderTests/ConfigProviderTest.cs index 489718869..92d2dc781 100644 --- a/NzbDrone.Core.Test/ProviderTests/ConfigProviderTest.cs +++ b/NzbDrone.Core.Test/ProviderTests/ConfigProviderTest.cs @@ -140,11 +140,8 @@ namespace NzbDrone.Core.Test.ProviderTests [Description("This test will use reflection to ensure each config property read/writes to a unique key")] public void config_properties_should_write_and_read_using_same_key() { - - WithStrictMocker(); - var configProvider = Mocker.Resolve(); - var allProperties = typeof(ConfigProvider).GetProperties(); + var allProperties = typeof(ConfigProvider).GetProperties().Where(p => p.GetSetMethod() != null); //Act diff --git a/NzbDrone.Core/CentralDispatch.cs b/NzbDrone.Core/CentralDispatch.cs index 04779a7b3..98ae058e3 100644 --- a/NzbDrone.Core/CentralDispatch.cs +++ b/NzbDrone.Core/CentralDispatch.cs @@ -60,7 +60,11 @@ namespace NzbDrone.Core private void InitAnalytics() { - var deskMetricsClient = new DeskMetricsClient(Kernel.Get().UGuid, AnalyticsProvider.DESKMETRICS_ID, _enviromentProvider.Version); + var appId = AnalyticsProvider.DESKMETRICS_TEST_ID; + if (EnviromentProvider.IsProduction) + appId = AnalyticsProvider.DESKMETRICS_PRODUCTION_ID; + + var deskMetricsClient = new DeskMetricsClient(Kernel.Get().UGuid, appId, _enviromentProvider.Version); Kernel.Bind().ToConstant(deskMetricsClient); Kernel.Get().Checkpoint(); } diff --git a/NzbDrone.Core/Providers/AnalyticsProvider.cs b/NzbDrone.Core/Providers/AnalyticsProvider.cs index face22241..3d550aad1 100644 --- a/NzbDrone.Core/Providers/AnalyticsProvider.cs +++ b/NzbDrone.Core/Providers/AnalyticsProvider.cs @@ -8,7 +8,8 @@ namespace NzbDrone.Core.Providers public class AnalyticsProvider { private readonly IDeskMetricsClient _deskMetricsClient; - public const string DESKMETRICS_ID = "4ea8d347a14ad71442000002"; + public const string DESKMETRICS_TEST_ID = "4ea8d347a14ad71442000002"; + public const string DESKMETRICS_PRODUCTION_ID = "4f20b01ea14ad729b2000000"; [Inject] public AnalyticsProvider(IDeskMetricsClient deskMetricsClient)