This commit is contained in:
Chris Cameron
2018-03-13 13:49:47 -04:00
parent 4f901db30e
commit 74ed7b4165
8 changed files with 27 additions and 28 deletions

View File

@@ -1,7 +1,7 @@
using ICD.Common.Utils.Extensions;
using NUnit.Framework;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using ICD.Common.Utils.Extensions;
using NUnit.Framework;
namespace ICD.Common.Utils.Tests.Extensions
{

View File

@@ -1,8 +1,8 @@
using ICD.Common.Utils.Collections;
using System.Collections.Generic;
using System.Linq;
using ICD.Common.Utils.Collections;
using ICD.Common.Utils.Extensions;
using NUnit.Framework;
using System.Collections.Generic;
using System.Linq;
namespace ICD.Common.Utils.Tests.Extensions
{
@@ -117,8 +117,8 @@ namespace ICD.Common.Utils.Tests.Extensions
[Test]
public void SequenceEqualTest()
{
int[] a = new[] {1, 2, 3, 4};
int[] b = new[] {1, 4, 9, 16};
int[] a = {1, 2, 3, 4};
int[] b = {1, 4, 9, 16};
Assert.IsFalse(a.SequenceEqual(b, (x, y) => x == y));
Assert.IsTrue(a.SequenceEqual(b, (x, y) => x * x == y));
@@ -508,7 +508,7 @@ namespace ICD.Common.Utils.Tests.Extensions
[Test]
public void ConsolidateTest()
{
string[] sequence = EnumerableExtensions.Consolidate(new[] {"A", "B", "B", "C"}).ToArray();
string[] sequence = new[] {"A", "B", "B", "C"}.Consolidate().ToArray();
Assert.AreEqual(3, sequence.Length, StringUtils.ArrayFormat(sequence));
Assert.AreEqual("A", sequence[0]);
@@ -519,7 +519,7 @@ namespace ICD.Common.Utils.Tests.Extensions
[Test]
public void ConsolidateComparerTest()
{
string[] sequence = EnumerableExtensions.Consolidate(new[] {"A", "B", "B", "C"}, Comparer<string>.Default).ToArray();
string[] sequence = new[] {"A", "B", "B", "C"}.Consolidate(Comparer<string>.Default).ToArray();
Assert.AreEqual(3, sequence.Length, StringUtils.ArrayFormat(sequence));
Assert.AreEqual("A", sequence[0]);

View File

@@ -1,5 +1,4 @@
using System;
using NUnit.Framework;
using NUnit.Framework;
namespace ICD.Common.Utils.Tests.Extensions
{

View File

@@ -51,7 +51,7 @@ namespace ICD.Common.Utils.Tests.Extensions
{
using (JsonWriter writer = new JsonTextWriter(stringWriter))
{
serializer.SerializeArray(writer, new int[] {1, 2, 3, 4});
serializer.SerializeArray(writer, new[] {1, 2, 3, 4});
}
}
@@ -76,7 +76,7 @@ namespace ICD.Common.Utils.Tests.Extensions
}
}
Assert.IsTrue(deserialized.SequenceEqual(new int[] {1, 2, 3, 4}));
Assert.IsTrue(deserialized.SequenceEqual(new[] {1, 2, 3, 4}));
}
[Test]

View File

@@ -1,7 +1,7 @@
using ICD.Common.Utils.Extensions;
using NUnit.Framework;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using ICD.Common.Utils.Extensions;
using NUnit.Framework;
namespace ICD.Common.Utils.Tests.Extensions
{

View File

@@ -1,6 +1,6 @@
using NUnit.Framework;
using System.Collections.Generic;
using System.Collections.Generic;
using ICD.Common.Utils.Extensions;
using NUnit.Framework;
namespace ICD.Common.Utils.Tests.Extensions
{
@@ -12,7 +12,7 @@ namespace ICD.Common.Utils.Tests.Extensions
{
Queue<int> queue = new Queue<int>();
queue.EnqueueRange(new int[] { 1, 2, 3 });
queue.EnqueueRange(new[] { 1, 2, 3 });
Assert.AreEqual(3, queue.Count);
Assert.AreEqual(1, queue.Dequeue());
@@ -24,7 +24,7 @@ namespace ICD.Common.Utils.Tests.Extensions
public void DequeueTest()
{
Queue<int> queue = new Queue<int>();
queue.EnqueueRange(new int[] { 1, 2, 3 });
queue.EnqueueRange(new[] { 1, 2, 3 });
int output;

View File

@@ -1,6 +1,6 @@
using NUnit.Framework;
using System.Text;
using System.Text;
using ICD.Common.Utils.Extensions;
using NUnit.Framework;
namespace ICD.Common.Utils.Tests.Extensions
{

View File

@@ -1,6 +1,6 @@
using ICD.Common.Utils.Extensions;
using System.Linq;
using ICD.Common.Utils.Extensions;
using NUnit.Framework;
using System.Linq;
namespace ICD.Common.Utils.Tests.Extensions
{
@@ -11,7 +11,7 @@ namespace ICD.Common.Utils.Tests.Extensions
public void IndexOfTest()
{
string first;
Assert.AreEqual(5, "test1test3test2".IndexOf(new string[] { "test2", "test3" }, out first));
Assert.AreEqual(5, "test1test3test2".IndexOf(new[] { "test2", "test3" }, out first));
Assert.AreEqual("test3", first);
}
@@ -63,7 +63,7 @@ namespace ICD.Common.Utils.Tests.Extensions
[Test]
public void SplitStringDelimitersTest()
{
string[] split = "1234567890".Split(new string[] { "23", "67" }).ToArray();
string[] split = "1234567890".Split(new[] { "23", "67" }).ToArray();
Assert.AreEqual(3, split.Length);
Assert.AreEqual("145890", string.Join("", split));
@@ -78,7 +78,7 @@ namespace ICD.Common.Utils.Tests.Extensions
[Test]
public void RemoveCharactersTest()
{
Assert.AreEqual("13457890", "1234567890".Remove(new char[] { '2', '6' }));
Assert.AreEqual("13457890", "1234567890".Remove(new[] { '2', '6' }));
}
[TestCase(true, "27652")]