From 6c27227c3ef2f25f28fa3300dd340798ebe142c2 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Mon, 14 Feb 2022 16:04:57 +0000 Subject: [PATCH] Remove char.Random test --- X10D.Tests/src/Core/CharTests.cs | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/X10D.Tests/src/Core/CharTests.cs b/X10D.Tests/src/Core/CharTests.cs index 1f4efe7..e973ceb 100644 --- a/X10D.Tests/src/Core/CharTests.cs +++ b/X10D.Tests/src/Core/CharTests.cs @@ -1,4 +1,4 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Microsoft.VisualStudio.TestTools.UnitTesting; namespace X10D.Tests.Core { @@ -8,26 +8,17 @@ namespace X10D.Tests.Core [TestClass] public class CharTests { - /// - /// Tests for . - /// - [TestMethod] - public void Random() - { - var set = "abcdefghijklmnopqrstuvwxyz".ToCharArray(); - var random = set.Random(20); - - Assert.IsTrue(random.All(c => Array.IndexOf(set, c) >= 0)); - Assert.IsFalse(random.Any(c => Array.IndexOf(set, c) < -1)); - } - - /// - /// Tests for . - /// [TestMethod] public void Repeat() { - Assert.AreEqual("aaaaaaaaaa", 'a'.Repeat(10)); + const char character = 'a'; + const int repeatCount = 10; + + const string repeated = "aaaaaaaaaa"; + var result = character.Repeat(repeatCount); + + Assert.AreEqual(repeated, result); + Assert.ThrowsException(() => character.Repeat(-1)); } } }