Beispiel #1
0
        public void FirstMissingNumber_WithEmptyArray_ThrowException()
        {
            var w = new int[] {};
            var a = new CodeSkill_MissingNumber.MissingNumberFinder(w);

            Assert.Throws <Exception>(() => a.FirstMissingNumber(), "Collection is empty, unspecified beginning of the collection");
        }
Beispiel #2
0
        public void FirstMissingNumber_WithAllNumbers_UpByOne()
        {
            var w = new int[] { -4, -3, -2, -1, 0, 1, 2, 3, 4 };
            var a = new CodeSkill_MissingNumber.MissingNumberFinder(w);

            Assert.That(a.FirstMissingNumber, Is.EqualTo(5));
        }