Skip to content

Commit 3dce237

Browse files
committed
Handle null as 0 for a few properties.
1 parent e3f78fb commit 3dce237

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/MartinCostello.BrowserStack.Automate/AutomatePlanStatus.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class AutomatePlanStatus
2626
/// <summary>
2727
/// Gets or sets the number of parallel sessions currently running.
2828
/// </summary>
29-
[JsonProperty("parallel_sessions_running")]
29+
[JsonProperty("parallel_sessions_running", NullValueHandling = NullValueHandling.Ignore)]
3030
public int ParallelSessionsRunning { get; set; }
3131

3232
/// <summary>
@@ -38,7 +38,7 @@ public class AutomatePlanStatus
3838
/// <summary>
3939
/// Gets or sets the number of parallel sessions currently queued.
4040
/// </summary>
41-
[JsonProperty("queued_sessions")]
41+
[JsonProperty("queued_sessions", NullValueHandling = NullValueHandling.Ignore)]
4242
public int QueuedParallelSessions { get; set; }
4343

4444
/// <summary>

src/MartinCostello.BrowserStack.Automate/Build.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class Build
2626
/// <summary>
2727
/// Gets or sets the duration of the build, in seconds.
2828
/// </summary>
29-
[JsonProperty("duration")]
29+
[JsonProperty("duration", NullValueHandling = NullValueHandling.Ignore)]
3030
public int Duration { get; set; }
3131

3232
/// <summary>

tests/MartinCostello.BrowserStack.Automate.Tests/BrowserStackAutomateClientTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ public static async Task Can_Query_BrowserStack_Automate_Api()
253253
build.Should().NotBeNull();
254254
build.Should().NotBeNull();
255255
build.CreatedAt.Should().BeOnOrAfter(project.CreatedAt);
256-
build.Duration.Should().BeGreaterOrEqualTo(1);
256+
build.Duration.Should().BeGreaterOrEqualTo(0);
257257
build.Id.Should().BeGreaterThan(0);
258258
build.HashedId.Should().NotBeNullOrEmpty();
259259
build.Name.Should().NotBeNullOrEmpty();

0 commit comments

Comments
 (0)