예제 #1
0
        public void FindLongestSequenceTest(int testNumber, int expectedLength)
        {
            // Act
            int resultLength1 = Question_5_3.FindLongestSequence(testNumber);
            int resultLength2 = Question_5_3.FindLongestSequenceOptimal(testNumber);

            // Assert
            Assert.AreEqual(expectedLength, resultLength1, $"Failed to find the longest sequence of 1s for {testNumber}.");
            Assert.AreEqual(expectedLength, resultLength2, $"Failed to find the longest sequence of 1s for {testNumber} - Optimal.");
        }
예제 #2
0
파일: Test_5_3.cs 프로젝트: jkrez/Interview
        public void Validate(int expected, int n)
        {
            var result = Question_5_3.FlipBit(n);

            Assert.AreEqual(expected, result);
        }