コード例 #1
0
        public void ReversedString(string myWord, string expected)
        {
            // Arrange
            var myTest = new MyExtraMethods();
            // Act
            string actual = myTest.ReversedString(myWord);

            // Assert
            Assert.Equal(expected, actual);
        }
コード例 #2
0
        public void TestIfPrime(int num, bool expected)
        {
            // Arrange
            var myTest = new MyExtraMethods();
            // Act
            bool actual = myTest.IsPrime(num);

            // Assert
            Assert.Equal(expected, actual);
        }
コード例 #3
0
        public void FindOddInt(int[] nums, int expected)
        {
            // Arrange
            var myTest = new MyExtraMethods();
            // Act
            int actual = myTest.FindOddInt(nums);

            // Assert
            Assert.Equal(expected, actual);
        }
コード例 #4
0
        public void LongestConsecTest(string[] strArray, int num, string expected)
        {
            // Arrange
            var myTest = new MyExtraMethods();
            // Act
            string actual = myTest.LongestConsec(strArray, num);

            // Assert
            Assert.Equal(expected, actual);
        }
コード例 #5
0
        public void WesternStyleEmoticon()
        {
            // Arrange
            var myTest = new MyExtraMethods();

            string[] emotArray = { ":-)", ":-(", ":/", ";)", ":o", ":|", "=)", "<3" };

            // Check all strings
            foreach (string emoticon in emotArray)
            {
                // Act
                bool actual = myTest.WesternStyleEmoticon(emoticon);

                // Assert
                Assert.True(actual);
            }
        }