Fixed broken tests, DeskMetrics now has a different id during dev and production.

This commit is contained in:
kay.one 2012-01-25 17:52:47 -08:00
parent 4ea475d428
commit 340f05aef4
3 changed files with 8 additions and 6 deletions

View File

@ -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<ConfigProvider>();
var allProperties = typeof(ConfigProvider).GetProperties();
var allProperties = typeof(ConfigProvider).GetProperties().Where(p => p.GetSetMethod() != null);
//Act

View File

@ -60,7 +60,11 @@ namespace NzbDrone.Core
private void InitAnalytics()
{
var deskMetricsClient = new DeskMetricsClient(Kernel.Get<ConfigProvider>().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<ConfigProvider>().UGuid, appId, _enviromentProvider.Version);
Kernel.Bind<IDeskMetricsClient>().ToConstant(deskMetricsClient);
Kernel.Get<AnalyticsProvider>().Checkpoint();
}

View File

@ -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)