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

loresoft / FluentRest / 7318593291

25 Dec 2023 02:55AM UTC coverage: 52.206%. Remained the same
7318593291

Pull #158

github

web-flow
Merge 38e3e6116 into 7b58509ff
Pull Request #158: Bump xunit.runner.visualstudio from 2.5.4 to 2.5.6

182 of 438 branches covered (0.0%)

Branch coverage included in aggregate %.

516 of 899 relevant lines covered (57.4%)

86.76 hits per line

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

50.0
/src/FluentRest.Fake/FakeContainerBuilder.cs
1
using System;
2

3
namespace FluentRest.Fake;
4

5
/// <summary>
6
/// A <see langword="base"/> fluent builder for a <see cref="FakeResponseContainer"/>.
7
/// </summary>
8
/// <typeparam name="TBuilder">The type of the builder.</typeparam>
9
public abstract class FakeContainerBuilder<TBuilder>
10
    where TBuilder : FakeContainerBuilder<TBuilder>
11
{
12
    /// <summary>
13
    /// Initializes a new instance of the <see cref="FakeContainerBuilder{TBuilder}"/> class.
14
    /// </summary>
15
    /// <param name="container">The container to build.</param>
16
    protected FakeContainerBuilder(FakeResponseContainer container)
17
    {
18
        Container = container;
45✔
19
    }
45✔
20

21
    /// <summary>
22
    /// Gets the fake response container.
23
    /// </summary>
24
    /// <value>
25
    /// The fake response container.
26
    /// </value>
27
    public FakeResponseContainer Container { get; }
28
}
29

30
/// <summary>
31
/// A fluent builder for a <see cref="FakeResponseContainer"/>.
32
/// </summary>
33
public class FakeContainerBuilder : FakeContainerBuilder<FakeContainerBuilder>
34
{
35
    /// <summary>
36
    /// Initializes a new instance of the <see cref="FakeContainerBuilder"/> class.
37
    /// </summary>
38
    /// <param name="container">The container to build.</param>
39
    public FakeContainerBuilder(FakeResponseContainer container) : base(container)
15✔
40
    {
41

42
    }
15✔
43

44
    /// <summary>
45
    /// Sets the URL that the current fake response is for.
46
    /// </summary>
47
    /// <param name="value">The URL the fake response if for.</param>
48
    /// <returns>A fluent fake response builder.</returns>
49
    /// <exception cref="System.ArgumentNullException"><paramref name="value" /> is <see langword="null" />.</exception>
50
    public FakeResponseBuilder Url(string value)
51
    {
52
        if (value == null)
15!
53
            throw new ArgumentNullException(nameof(value));
×
54

55
        Container.RequestUri = new Uri(value, UriKind.Absolute);
15✔
56

57
        return new FakeResponseBuilder(Container);
15✔
58
    }
59

60
    /// <summary>
61
    /// Sets the URL that the current fake response is for.
62
    /// </summary>
63
    /// <param name="value">The URL the fake response if for.</param>
64
    /// <returns>A fluent fake response builder.</returns>
65
    /// <exception cref="System.ArgumentNullException"><paramref name="value" /> is <see langword="null" />.</exception>
66
    public FakeResponseBuilder Url(Uri value)
67
    {
68
        if (value == null)
×
69
            throw new ArgumentNullException(nameof(value));
×
70

71
        Container.RequestUri = value;
×
72

73
        return new FakeResponseBuilder(Container);
×
74
    }
75
}
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