From 3d3f032d7997435cf2d358703efe50a5a4a2baf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro?= Date: Mon, 3 Dec 2018 17:25:03 +0000 Subject: [PATCH] Added tests for Array.Empty(). --- .../Cosmos.Compiler.Tests.Bcl/System/ArrayTests.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Tests/Kernels/Cosmos.Compiler.Tests.Bcl/System/ArrayTests.cs b/Tests/Kernels/Cosmos.Compiler.Tests.Bcl/System/ArrayTests.cs index 2335e1001..48b07cfcc 100644 --- a/Tests/Kernels/Cosmos.Compiler.Tests.Bcl/System/ArrayTests.cs +++ b/Tests/Kernels/Cosmos.Compiler.Tests.Bcl/System/ArrayTests.cs @@ -1,8 +1,5 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; + using Cosmos.TestRunner; namespace Cosmos.Compiler.Tests.Bcl.System @@ -11,6 +8,12 @@ namespace Cosmos.Compiler.Tests.Bcl.System { public static void Execute() { + byte[] xEmptyByteArray = Array.Empty(); + object[] xEmptyObjectArray = Array.Empty(); + + Assert.IsTrue(xEmptyByteArray.Length == 0, "Array.Empty should return an empty array!"); + Assert.IsTrue(xEmptyObjectArray.Length == 0, "Array.Empty should return an empty array!"); + byte[] xByteResult = { 1, 2, 3, 4, 5, 6, 7, 8 }; byte[] xByteExpectedResult = { 1, 2, 3, 4, 5, 6, 7, 1 }; byte[] xByteSource = { 1 };