Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
FriggaHel committed Mar 19, 2024
1 parent 2f82234 commit 35b7b3b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions visual-dotnet/SauceLabs.Visual/VisualClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class VisualClient : IDisposable
private readonly string _jobId;
private string? _sessionMetadataBlob;
private readonly List<string> _screenshotIds = new List<string>();
public VisualBuild? Build { get; private set; }
public VisualBuild Build { get; private set; }
private bool _externalBuild;
public bool CaptureDom { get; set; } = false;
private readonly ResiliencePipeline _retryPipeline;
Expand Down Expand Up @@ -222,7 +222,6 @@ private async Task FinishBuild(VisualBuild build)
/// <returns></returns>
public async Task<string> VisualCheck(string name, VisualCheckOptions? options = null)
{
if (Build == null) throw new VisualClientException("no visual build available");
var ignored = new List<RegionIn>();
ignored.AddRange(options?.IgnoreRegions?.Select(r => new RegionIn(r)) ?? new List<RegionIn>());
ignored.AddRange(options?.IgnoreElements?.Select(r => new RegionIn(r)) ?? new List<RegionIn>());
Expand All @@ -245,7 +244,6 @@ public async Task<string> VisualCheck(string name, VisualCheckOptions? options =
/// </summary>
public async Task Cleanup()
{
if (Build == null) throw new VisualClientException("no visual build available");
if (!_externalBuild)
{
await FinishBuild(Build);
Expand All @@ -264,7 +262,6 @@ public void Dispose()
/// <exception cref="VisualClientException"></exception>
public async Task<Dictionary<DiffStatus, int>> VisualResults()
{
if (Build == null) throw new VisualClientException("no visual build available");
return await _retryPipeline.ExecuteAsync(async token => await FetchVisualResults(Build.Id));
}

Expand Down

0 comments on commit 35b7b3b

Please sign in to comment.