public void TestFillZeroWithSource() { var actual = Arr.Fill(0, 3, "foo", foobar); CollectionAssert.AreEqual( new[] { "foo", "foo", "foo", "foo", "bar", "baz", }, actual); }
public void TestFillZeroStart() { var result = Arr.Fill(0, 5, "aaa"); Assert.AreEqual("aaa", result[0]); Assert.AreEqual("aaa", result[1]); Assert.AreEqual("aaa", result[2]); Assert.AreEqual("aaa", result[3]); Assert.AreEqual("aaa", result[4]); }
public void TestFillOutOfRangeWithSource() { var actual = Arr.Fill(4, 2, "foo", foobar); CollectionAssert.AreEqual( new[] { "foo", "bar", "baz", null, "foo", "foo", }, actual); }
public void TestFillZeroStart() { var actual = Arr.Fill(0, 5, "foo"); CollectionAssert.AreEqual( new[] { "foo", "foo", "foo", "foo", "foo", }, actual); }
public void TestFill() { var actual = Arr.Fill(1, 5, "foo"); CollectionAssert.AreEqual( new[] { null, "foo", "foo", "foo", "foo", "foo", }, actual); }
public void TestFill() { var result = Arr.Fill(1, 5, "aaa"); Assert.AreEqual(null, result[0]); Assert.AreEqual("aaa", result[1]); Assert.AreEqual("aaa", result[2]); Assert.AreEqual("aaa", result[3]); Assert.AreEqual("aaa", result[4]); Assert.AreEqual("aaa", result[5]); }
public void TestFillException() { ExceptionAssert.Throws <ArgumentOutOfRangeException>(() => { Arr.Fill(-1, 3, "aaa", new[] { "dog", "cat", "white", "red", "world" }); }); ExceptionAssert.Throws <ArgumentOutOfRangeException>(() => { Arr.Fill(0, 0, "aaa", new[] { "dog", "cat", "white", "red", "world" }); }); }
public void TestFillThrowException() { Assert.ThrowsException <ArgumentOutOfRangeException>(() => { Arr.Fill(-1, 3, "foo"); }); Assert.ThrowsException <ArgumentOutOfRangeException>(() => { Arr.Fill(0, 0, "foo"); }); }
public void TestFillZeroWithSource() { var result = Arr.Fill(0, 3, "aaa", new[] { "dog", "cat", "white", "red", "world" }); Assert.AreEqual("aaa", result[0]); Assert.AreEqual("aaa", result[1]); Assert.AreEqual("aaa", result[2]); Assert.AreEqual("dog", result[3]); Assert.AreEqual("cat", result[4]); Assert.AreEqual("white", result[5]); Assert.AreEqual("red", result[6]); Assert.AreEqual("world", result[7]); }
public void TestFillWithSource() { var data = new[] { "dog", "cat", "white", "red", "world" }; var result = Arr.Fill(2, 3, "aaa", data); Assert.AreEqual("dog", result[0]); Assert.AreEqual("cat", result[1]); Assert.AreEqual("aaa", result[2]); Assert.AreEqual("aaa", result[3]); Assert.AreEqual("aaa", result[4]); Assert.AreEqual("white", result[5]); Assert.AreEqual("red", result[6]); Assert.AreEqual("world", result[7]); Assert.AreEqual("dog", data[0]); Assert.AreEqual("cat", data[1]); Assert.AreEqual("white", data[2]); Assert.AreEqual("red", data[3]); Assert.AreEqual("world", data[4]); }