public void IsValidPeople_Valid() { CrossTheBridgeHelper helper = new CrossTheBridgeHelper(); List<int> people = new List<int>() { 10, 5, 2, 1 }; Assert.IsTrue(helper.IsValid(people)); }
public void IsDone_Not() { CrossTheBridgeHelper helper = new CrossTheBridgeHelper(); var APart = new int[] { 0, 0, 0, 1 }; Assert.IsFalse(helper.IsDone(APart)); }
public void IsDone_Done() { CrossTheBridgeHelper helper = new CrossTheBridgeHelper(); var APart = new int[] { 0, 0, 0, 0 }; Assert.IsTrue(helper.IsDone(APart)); }
public void GetSmallestNumberIndex_2() { CrossTheBridgeHelper helper = new CrossTheBridgeHelper(); List<int> people = new List<int>() { 10, 5, 2, 0 }; Assert.AreEqual(helper.GetSmallestNumberIndex(people.ToArray()), 2); }
public void SendLargestPair() { CrossTheBridgeHelper helper = new CrossTheBridgeHelper(); var APart = new List<int>() { 10, 5, 2, 1 }.ToArray(); var BPart = new int[] { 0, 0, 0, 0 }; int result = helper.SendLargestPair(ref APart, ref BPart); CollectionAssert.AreEqual(APart, new int[] { 0, 0, 2, 1 }); CollectionAssert.AreEqual(BPart, new int[] { 10, 5, 0, 0 }); Assert.AreEqual(result, 10); }
public void SortPeople() { CrossTheBridgeHelper helper = new CrossTheBridgeHelper(); List<int> people = new List<int>() { 1, 2, 5, 10 }; var sortedPeople = helper.Sort(people); CollectionAssert.AreEqual(sortedPeople, new List<int> { 10, 5, 2, 1 }); }