public void Format_DefaultConfig_PropertyNameNotChanged() { CheckDefault(_defaultFormatter); MixpanelConfig.Global.MixpanelPropertyNameFormat = MixpanelPropertyNameFormat.SentenceCase; var formatter = new PropertyNameFormatter(new MixpanelConfig()); CheckDefault(formatter); }
public void Format_TitleCaseConfig_PropertyNameChanged() { MixpanelConfig.Global.MixpanelPropertyNameFormat = MixpanelPropertyNameFormat.TitleCase; CheckTitleCase(_defaultFormatter); MixpanelConfig.Global.MixpanelPropertyNameFormat = MixpanelPropertyNameFormat.None; var formatter = new PropertyNameFormatter( new MixpanelConfig {MixpanelPropertyNameFormat = MixpanelPropertyNameFormat.TitleCase}); CheckTitleCase(formatter); }
private void CheckSentenceCase(PropertyNameFormatter formatter) { Assert.That(formatter.Format("SomeCoolProperty"), Is.EqualTo("Some cool property")); Assert.That(formatter.Format("someCoolProperty"), Is.EqualTo("Some cool property")); Assert.That(formatter.Format("prop"), Is.EqualTo("Prop")); Assert.That(formatter.Format("PropP"), Is.EqualTo("Prop p")); Assert.That(formatter.Format("PropP"), Is.EqualTo("Prop p")); Assert.That(formatter.Format("Some Cool Property"), Is.EqualTo("Some cool property")); }
private void CheckDefault(PropertyNameFormatter formatter) { Assert.That(formatter.Format("SomeCoolProperty"), Is.EqualTo("SomeCoolProperty")); Assert.That(formatter.Format("someCoolProperty"), Is.EqualTo("someCoolProperty")); }
public void SetUp() { MixpanelConfig.Global.Reset(); _defaultFormatter = new PropertyNameFormatter(); }