Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Omondi committed Aug 1, 2024
1 parent 389b76d commit b531e35
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/abstractions/Helpers/EnumHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ private static bool TryGetFieldValueName(Type type, string rawValue, out string
if(type.GetField(name)?.GetCustomAttribute<EnumMemberAttribute>() is { } attribute)
return attribute.Value;

return name.ToFirstCharacterLowerCase();
return name;
}
}
}
6 changes: 3 additions & 3 deletions tests/serialization/form/FormSerializationWriterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void WritesSampleObjectValue()

// Assert
var expectedString = "id=48d31887-5fad-4d73-a9f5-3c356e68a038&" +
"numbers=one%2Ctwo&" + // serializes enums
"numbers=One%2CTwo&" + // serializes enums
"workDuration=PT1H&" + // Serializes timespans
"birthDay=2017-09-04&" + // Serializes dates
"startWorkTime=08%3A00%3A00&" + //Serializes times
Expand Down Expand Up @@ -432,7 +432,7 @@ public void WriteEnumValue_IsWrittenCorrectly()
var serializedString = reader.ReadToEnd();

// Assert
Assert.Equal("prop1=sixteen", serializedString);
Assert.Equal("prop1=Sixteen", serializedString);
}

[Fact]
Expand Down Expand Up @@ -468,6 +468,6 @@ public void WriteCollectionOfEnumValues_IsWrittenCorrectly()
var serializedString = reader.ReadToEnd();

// Assert
Assert.Equal("prop1=sixteen%2Ctwo", serializedString);
Assert.Equal("prop1=Sixteen%2CTwo", serializedString);
}
}
4 changes: 2 additions & 2 deletions tests/serialization/json/JsonSerializationWriterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public void WritesSampleCollectionOfObjectValues()
// Assert
var expectedString = "[{" +
"\"id\":\"48d31887-5fad-4d73-a9f5-3c356e68a038\"," +
"\"numbers\":\"one,two\"," +
"\"numbers\":\"One,Two\"," +
"\"testNamingEnum\":\"Item2:SubItem1\"," +
"\"mobilePhone\":null," +
"\"accountEnabled\":false," +
Expand Down Expand Up @@ -206,7 +206,7 @@ public void WritesEnumValuesAsCamelCasedIfNotEscaped()

// Assert
var expectedString = "[{" +
"\"testNamingEnum\":\"item1\"" + // Camel Cased
"\"testNamingEnum\":\"Item1\"" + // Camel Cased
"}]";
Assert.Equal(expectedString, serializedJsonString);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/serialization/text/TextSerializationWriterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ public void WriteEnumValue_IsWrittenCorrectly()
var serializedString = reader.ReadToEnd();

// Assert
Assert.Equal("firstItem", serializedString);
Assert.Equal("FirstItem", serializedString);
}


Expand Down

0 comments on commit b531e35

Please sign in to comment.