public void GetFieldNameForProperty_returns_right_name_for_camel_cased_property() { // Arrange var namingConventions = new DefaultNamingConventions(new PluralizationService()); // Act var name = namingConventions.GetFieldNameForProperty(typeof(SomeClass).GetProperty("SomeKey")); // Assert name.Should().Be("some-key"); }
public void GetFieldNameForProperty_returns_right_name_for_property_with_JsonProperty_attribute() { // Arrange var namingConventions = new DefaultNamingConventions(new PluralizationService()); // Act var name = namingConventions.GetFieldNameForProperty(typeof(Band).GetProperty("Genre")); // Assert name.Should().Be("THE-GENRE"); }
public void GetFieldNameForProperty_returns_right_name_for_id() { // Arrange var namingConventions = new DefaultNamingConventions(new PluralizationService()); // Act var name = namingConventions.GetFieldNameForProperty(typeof(Author).GetProperty("Id")); // Assert name.Should().Be("id"); }