• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ShipEngine / shipengine-dotnet / 9670357484
84%
main: 83%

Build:
Build:
LAST BUILD BRANCH: ENGINE-7190-funding-sources-wallet-errors
DEFAULT BRANCH: main
Ran 25 Jun 2024 10:19PM UTC
Jobs 1
Files 31
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

25 Jun 2024 10:18PM UTC coverage: 84.271% (-1.1%) from 85.36%
9670357484

Pull #92

github

joshuaflanagan
Demonstrate backward-compatible deprecation of enums

I would like to get rid of using C# enums in the SDK. They unnecessarily constrain the
values that a user can send to the ShipEngine API. The API expects a string, the SDK
should allow the user to specify a string. An enum requires converting values to an integer,
which has no value for our purposes. It also leads to awkwardness when the default is `0`,
which will correspond to an enum value we don't necessarily want. It requires the user
to update their SDK any time there is a new possible value accepted by the API.
We can still provide guidance for valid values via classes that expose static strings.

However, there is likely code in the wild where users are setting properties to an enum value.
This is an experiment to demonstrate using implicit conversion operators, and a custom JsonConverter,
to allow a user to set a "string enum" value using a string or an enum.
Pull Request #92: Demonstrate backward-compatible deprecation of enums

44 of 78 branches covered (56.41%)

Branch coverage included in aggregate %.

46 of 58 new or added lines in 2 files covered. (79.31%)

690 of 793 relevant lines covered (87.01%)

14.79 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
12
70.77
ShipEngine/Models/Dto/CreateLabelFromShipmentDetails/StringEnum.cs
Jobs
ID Job ID Ran Files Coverage
1 run- - 9670357484.1 25 Jun 2024 10:19PM UTC 31
84.27
GitHub Action Run
Source Files on build 9670357484
  • Tree
  • List 31
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Pull Request #92
  • PR Base - main (#9486504073)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc