mirror of https://github.com/Radarr/Radarr
Fixed broken tests, DeskMetrics now has a different id during dev and production.
This commit is contained in:
parent
4ea475d428
commit
340f05aef4
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue