public void Test_RandomDecOfCards() { Card[] Cards = new Card[10]; for (int i = 0; i < Cards.Length; i++) { Cards[i].Value = i + 1; } CH_01 ch = new CH_01(); Card[] deck = ch.ShuffleCards(Cards); deck = ch.ShuffleCards2(Cards); Cards = new Card[52]; for (int i = 0; i < Cards.Length; i++) { Cards[i].Value = i + 1; } deck = ch.ShuffleCards2(Cards); //for (int i = 0; i < Cards.Length; i++) //{ // Assert.IsFalse(Cards[i].Value == deck[i].Value, "Position {0} not suffled", i ); //} }
public void Test_ArrayMultiplication() { int[] X = new int[] { 9, 8, 7, 6, 5 }; int[] Y = new int[] { 4, 3, 2 }; string z = CH_01.Multiply(X, Y); Assert.IsTrue(z.Equals("42666480"), "98765 * 432 = 42666480"); X = new int[] { 9, 9, 9 }; z = CH_01.Multiply(X, X); Assert.IsTrue(z.Equals("998001"), "999 * 999 = 998001"); }