1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-25 09:21:57 +00:00

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 @@ public void uguid_should_return_valid_result_on_first_call()
[Description("This test will use reflection to ensure each config property read/writes to a unique key")] [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() public void config_properties_should_write_and_read_using_same_key()
{ {
WithStrictMocker();
var configProvider = Mocker.Resolve<ConfigProvider>(); var configProvider = Mocker.Resolve<ConfigProvider>();
var allProperties = typeof(ConfigProvider).GetProperties(); var allProperties = typeof(ConfigProvider).GetProperties().Where(p => p.GetSetMethod() != null);
//Act //Act

View file

@ -60,7 +60,11 @@ private void InitDatabase()
private void InitAnalytics() 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.Bind<IDeskMetricsClient>().ToConstant(deskMetricsClient);
Kernel.Get<AnalyticsProvider>().Checkpoint(); Kernel.Get<AnalyticsProvider>().Checkpoint();
} }

View file

@ -8,7 +8,8 @@ namespace NzbDrone.Core.Providers
public class AnalyticsProvider public class AnalyticsProvider
{ {
private readonly IDeskMetricsClient _deskMetricsClient; 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] [Inject]
public AnalyticsProvider(IDeskMetricsClient deskMetricsClient) public AnalyticsProvider(IDeskMetricsClient deskMetricsClient)