Exemple #1
0
        public void Compare_XLessThanY_ReturnFalse()
        {
            var sortAlgorithm = new SortAlgorithm();
            var bacon         = new string[] { "B", "A" };

            var result = sortAlgorithm.Compare(bacon[0], bacon[1]);

            Assert.IsFalse(result);
        }
Exemple #2
0
        public void Exchange_ReturnTrue()
        {
            var sortAlgorithm = new SortAlgorithm();
            var bacon         = new string[] { "B", "A" };

            sortAlgorithm.Exchange(bacon, 0, 1);

            Assert.IsTrue(bacon[0] == "A");
            Assert.IsTrue(bacon[1] == "B");
        }
Exemple #3
0
        public void IsSorted_ArrayIsSorted_ReturnTrue()
        {
            // Setup
            var sortAlgorithm = new SortAlgorithm();
            var bacon         = new string[] { "A", "B", "C", "D" };

            // Operate
            var result = sortAlgorithm.IsSorted(bacon);

            // Assert
            Assert.IsTrue(result);
        }
Exemple #4
0
 static void Main(string[] args)
 {
     var sort  = new SortAlgorithm();
     var bacon = new string[] { "I", "A", "H", "C", "F", "E", "D", "G", "B" };
 }