public void TestBonusInspection() { // arrange var expandReels = new bool[] { false, false, false, false, false }; var user = new UserGameKey(-1, 32); var wheel1 = new List <int[]> { new [] { 0, 1, 2 }, new [] { 0, 7, 1 }, new [] { 4, 5, 6 }, new [] { 1, 2, 3 }, new [] { 6, 5, 4 } }; var wheel2 = new List <int[]> { new [] { 0, 1, 2 }, new [] { 0, 5, 1 }, new [] { 7, 5, 6 }, new [] { 1, 2, 3 }, new [] { 6, 5, 4 } }; var wheel3 = new List <int[]> { new [] { 0, 1, 2 }, new [] { 0, 2, 1 }, new [] { 4, 5, 6 }, new [] { 1, 2, 7 }, new [] { 6, 5, 4 } }; var wheel4 = new List <int[]> { new [] { 0, 1, 2 }, new [] { 0, 2, 1 }, new [] { 4, 5, 6 }, new [] { 1, 2, 0 }, new [] { 6, 5, 4 } }; // Action var result1 = BonusInspection.InspectReSpin(wheel1, expandReels); var result2 = BonusInspection.InspectReSpin(wheel2, expandReels); var result3 = BonusInspection.InspectReSpin(wheel3, expandReels); var result4 = BonusInspection.InspectReSpin(wheel4, expandReels); // Assert Assert.IsTrue(result1.HasValue); Assert.IsTrue(result1.ValueOrDefault().Item.Count == 1); Assert.IsTrue(result2.HasValue); Assert.IsTrue(result2.ValueOrDefault().Item.Count == 1); Assert.IsTrue(result3.HasValue); Assert.IsTrue(result3.ValueOrDefault().Item.Count == 1); Assert.IsTrue(result4.None); }
public void TestBonusBuilder() { // arrange var user = new UserGameKey(-1, 80); var wheel1 = new List <int[]> { new [] { 9, 9, 9 }, new [] { 0, 3, 1, 0 }, new [] { 0, 6, 3, 0 }, new [] { 0, 3, 2, 0 }, new [] { 2, 3, 4 } }; var wheel2 = new List <int[]> { new [] { 0, 2, 1 }, new [] { 0, 10, 1, 0 }, new [] { 0, 10, 3, 0 }, new [] { 7, 10, 2, 0 }, new [] { 2, 3, 4 } }; // action var result1 = BonusInspection.InspectFreeSpin(wheel1); var result2 = BonusInspection.InspectReSpin(new[] { 0 }, wheel1); var result3 = BonusInspection.InspectFreeSpin(wheel2); var result4 = BonusInspection.InspectReSpin(new[] { 0 }, wheel2); // Assert Assert.IsTrue(result1.None); Assert.IsTrue(result2.HasValue); Assert.IsTrue(result2.ValueOrDefault().Item.Count == 3); Assert.AreEqual(result2.ValueOrDefault().At, new[] { 1, 0, 0, 0, 0 }); Assert.IsTrue(result3.HasValue); Assert.IsTrue(result3.ValueOrDefault().Item.Count == 10); Assert.AreEqual(result3.ValueOrDefault().At, new[] { 0, 2, 2, 2, 0 }); Assert.IsTrue(result4.None); }