Skip to content

Commit

Permalink
Use target-typed new
Browse files Browse the repository at this point in the history
Use target-typed new to simplify some code.
  • Loading branch information
martincostello committed Nov 26, 2023
1 parent 317c46a commit 4655865
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions test/LondonTravel.Skill.Tests/FunctionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

namespace MartinCostello.LondonTravel.Skill;

#pragma warning disable SA1010

public abstract class FunctionTests : ITestOutputHelperAccessor
{
protected FunctionTests(ITestOutputHelper outputHelper)
Expand Down Expand Up @@ -70,9 +72,7 @@ protected virtual SkillRequest CreateIntentRequest(string name, params Slot[] sl

if (slots.Length > 0)
{
#pragma warning disable SA1010
request.Intent.Slots = [];
#pragma warning restore SA1010

foreach (var slot in slots)
{
Expand All @@ -98,30 +98,30 @@ protected virtual SkillRequest CreateRequest<T>(T request = null)

var result = new SkillRequest()
{
Context = new Context()
Context = new()
{
AudioPlayer = new PlaybackState()
AudioPlayer = new()
{
PlayerActivity = "IDLE",
},
System = new AlexaSystem()
System = new()
{
Application = application,
Device = new Device()
Device = new()
{
SupportedInterfaces = new Dictionary<string, object>()
SupportedInterfaces = new()
{
["AudioPlayer"] = new object(),
["AudioPlayer"] = new(),
},
},
User = user,
},
},
Request = request ?? new T(),
Session = new Session()
Session = new()
{
Application = application,
Attributes = new Dictionary<string, object>(),
Attributes = [],
New = true,
User = user,
},
Expand Down

0 comments on commit 4655865

Please sign in to comment.