Skip to content

Commit

Permalink
add single playsource PlayOptions constructor overload (#36825)
Browse files Browse the repository at this point in the history
  • Loading branch information
atazimsft authored and vivekmore-msft committed Aug 6, 2023
1 parent 02ee19e commit 8730adf
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,14 @@ public PlayOptions(IEnumerable<PlaySource> playSources, IEnumerable<Communicatio
PlaySources = playSources.ToList();
PlayTo = playTo.ToList();
}

/// <summary>
/// Creates a new PlayOptions object.
/// </summary>
public PlayOptions(PlaySource playSource, IEnumerable<CommunicationIdentifier> playTo)
{
PlaySources = new List<PlaySource> { playSource };
PlayTo = playTo.ToList();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,12 @@ public PlayToAllOptions(IEnumerable<PlaySource> playSources)
{
PlaySources = playSources.ToList();
}

/// <summary>
/// Creates a new PlayToAllOptions object.
/// </summary>
public PlayToAllOptions(PlaySource playSource)
{
PlaySources = new List<PlaySource> { playSource };
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ public class CallMediaTests : CallAutomationTestBase
};
private static readonly FileSource _fileSource = new FileSource(new System.Uri("file://path/to/file"));

private static readonly PlayOptions _fileOptions = new PlayOptions(new List<PlaySource> { _fileSource }, _target)
private static readonly PlayOptions _fileOptions = new PlayOptions(_fileSource, _target)
{
Loop = false,
OperationContext = "context"
};

private static readonly PlayToAllOptions _filePlayToAllOptions = new PlayToAllOptions(new List<PlaySource> { _fileSource })
private static readonly PlayToAllOptions _filePlayToAllOptions = new PlayToAllOptions(_fileSource )
{
Loop = false,
OperationContext = "context"
Expand Down

0 comments on commit 8730adf

Please sign in to comment.