From 4655865f34a691b28868d14a2595a32482d25a92 Mon Sep 17 00:00:00 2001 From: martincostello Date: Sun, 26 Nov 2023 11:16:52 +0000 Subject: [PATCH] Use target-typed new Use target-typed new to simplify some code. --- .../LondonTravel.Skill.Tests/FunctionTests.cs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/LondonTravel.Skill.Tests/FunctionTests.cs b/test/LondonTravel.Skill.Tests/FunctionTests.cs index 97b4be30..e11d2b56 100644 --- a/test/LondonTravel.Skill.Tests/FunctionTests.cs +++ b/test/LondonTravel.Skill.Tests/FunctionTests.cs @@ -12,6 +12,8 @@ namespace MartinCostello.LondonTravel.Skill; +#pragma warning disable SA1010 + public abstract class FunctionTests : ITestOutputHelperAccessor { protected FunctionTests(ITestOutputHelper outputHelper) @@ -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) { @@ -98,30 +98,30 @@ protected virtual SkillRequest CreateRequest(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() + SupportedInterfaces = new() { - ["AudioPlayer"] = new object(), + ["AudioPlayer"] = new(), }, }, User = user, }, }, Request = request ?? new T(), - Session = new Session() + Session = new() { Application = application, - Attributes = new Dictionary(), + Attributes = [], New = true, User = user, },