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

ThreeMammals / Ocelot / 26241073880

21 May 2026 05:06PM UTC coverage: 95.327% (+0.6%) from 94.721%
26241073880

push

github

raman-m
Ref SDK 10.0.300 (Runtime 10.0.8) to release Ocelot v25 beta 3 and Ocelot.Testing v25 beta 8+ (#2389)

* Prepare to release Ocelot.Testing v25.0.0-beta.8 package
* Bump all packages to the latest versions, including .NET SDK 10.0.203 (Runtime 10.0.7) released April 21, 2026
* Migrate unit testing from VSTest framework to Microsoft.Testing.Platform
* Do not use 'Cake Build' step in PR workflow, use plain dotnet scripting instead
* Fix "Unit Tests" step in PR workflow
* Rename job to "build" since it's not Cake anymore
* Suppress non-zero result and check test running status
* Update "Acceptance Tests" step
* Don't collect Coverlet code coverage data in "Acceptance Tests" step
* Update prepare-coveralls.sh
* Prepare Coveralls script v2
* Prepare Coveralls script v3
* Prepare Coveralls script v4
* Prepare Coveralls script v5 -> Add 2nd BUILD_CONFIGURATION argument
* Upgrade to SDK 10.0.300 aka Runtime 10.0.8
* Update samples
* Update workflows: prefer plain dotnet scripting over Cake Build

6752 of 7083 relevant lines covered (95.33%)

2730.81 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.84
src/Ocelot/Middleware/HttpItemsExtensions.cs
1
using Ocelot.Configuration;
2
using Ocelot.DownstreamRouteFinder.UrlMatcher;
3
using Ocelot.Errors;
4
using Ocelot.Request.Middleware;
5

6
namespace Ocelot.Middleware;
7

8
public static class HttpItemsExtensions
9
{
10
    public static void UpsertDownstreamRequest(this IDictionary<object, object> input, DownstreamRequest downstreamRequest)
11
    {
233✔
12
        input.Upsert("DownstreamRequest", downstreamRequest);
233✔
13
    }
233✔
14

15
    public static void UpsertDownstreamResponse(this IDictionary<object, object> input, DownstreamResponse downstreamResponse)
16
    {
42✔
17
        input.Upsert("DownstreamResponse", downstreamResponse);
42✔
18
    }
42✔
19

20
    public static void UpsertDownstreamRoute(this IDictionary<object, object> input, DownstreamRoute downstreamRoute)
21
    {
305✔
22
        input.Upsert("DownstreamRoute", downstreamRoute);
305✔
23
    }
305✔
24

25
    public static void UpsertTemplatePlaceholderNameAndValues(this IDictionary<object, object> input, List<PlaceholderNameAndValue> tPNV)
26
    {
224✔
27
        input.Upsert("TemplatePlaceholderNameAndValues", tPNV);
224✔
28
    }
224✔
29

30
    public static void UpsertDownstreamRoute(this IDictionary<object, object> input, DownstreamRouteFinder.DownstreamRouteHolder downstreamRoute)
31
    {
145✔
32
        input.Upsert("DownstreamRouteHolder", downstreamRoute);
145✔
33
    }
145✔
34

35
    public static void UpsertErrors(this IDictionary<object, object> input, List<Error> errors)
36
    {
8✔
37
        input.Upsert("Errors", errors);
8✔
38
    }
8✔
39

40
    public static void SetError(this IDictionary<object, object> input, Error error)
41
    {
15✔
42
        var errors = new List<Error> { error };
15✔
43
        input.Upsert("Errors", errors);
15✔
44
    }
15✔
45

46
    public static void SetIInternalConfiguration(this IDictionary<object, object> input, IInternalConfiguration config)
47
    {
82✔
48
        input.Upsert("IInternalConfiguration", config);
82✔
49
    }
82✔
50

51
    public static IInternalConfiguration IInternalConfiguration(this IDictionary<object, object> input)
52
    {
90✔
53
        return input.Get<IInternalConfiguration>("IInternalConfiguration");
90✔
54
    }
90✔
55

56
    public static List<Error> Errors(this IDictionary<object, object> input)
57
    {
148✔
58
        var errors = input.Get<List<Error>>("Errors");
148✔
59
        return errors ?? new();
148✔
60
    }
148✔
61

62
    public static DownstreamRouteFinder.DownstreamRouteHolder
63
        DownstreamRouteHolder(this IDictionary<object, object> input) =>
64
        input.Get<DownstreamRouteFinder.DownstreamRouteHolder>("DownstreamRouteHolder");
19✔
65

66
    public static List<PlaceholderNameAndValue>
67
        TemplatePlaceholderNameAndValues(this IDictionary<object, object> input) =>
68
        input.Get<List<PlaceholderNameAndValue>>("TemplatePlaceholderNameAndValues");
79✔
69

70
    public static DownstreamRequest DownstreamRequest(this IDictionary<object, object> input) =>
71
        input.Get<DownstreamRequest>("DownstreamRequest");
164✔
72

73
    public static DownstreamResponse DownstreamResponse(this IDictionary<object, object> input) =>
74
        input.Get<DownstreamResponse>("DownstreamResponse");
163✔
75

76
    public static DownstreamRoute DownstreamRoute(this IDictionary<object, object> input) =>
77
        input.Get<DownstreamRoute>("DownstreamRoute");
299✔
78

79
    private static T Get<T>(this IDictionary<object, object> input, string key) =>
80
    input.TryGetValue(key, out var value) ? (T)value : default;
962✔
81

82
    private static void Upsert<T>(this IDictionary<object, object> input, string key, T value)
83
    {
1,054✔
84
        if (input.DoesntExist(key))
1,054✔
85
        {
1,054✔
86
            input.Add(key, value);
1,054✔
87
        }
1,054✔
88
        else
89
        {
×
90
            input.Remove(key);
×
91
            input.Add(key, value);
×
92
        }
×
93
    }
1,054✔
94

95
    private static bool DoesntExist(this IDictionary<object, object> input, string key) => !input.ContainsKey(key);
1,054✔
96
}
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

© 2026 Coveralls, Inc