예제 #1
0
        public void GetTextSimilarity_ShouldThrowArgumentNullException_WhenInputTwoIsNull()
        {
            // Arrange
            string inputOne = "test";
            string inputTwo = null;

            // Act
            double actualSimilarity = StringCompare.GetTextSimilarity(inputOne, inputTwo);
        }
예제 #2
0
        public void GetTextSimilarity_ShouldReturnOne_WhenBothInputsEmpty()
        {
            // Arrange
            string inputOne = "";
            string inputTwo = "";

            // Act
            double actualSimilarity = StringCompare.GetTextSimilarity(inputOne, inputTwo);

            // Assert
            Assert.AreEqual <double>(expected: 1, actual: actualSimilarity);
        }
예제 #3
0
        public void GetTextSimilarity_ShouldReturnQuarter_WhenInputsQuarterSame()
        {
            // Arrange
            string inputOne = "test";
            string inputTwo = "txyz";

            // Act
            double actualSimilarity = StringCompare.GetTextSimilarity(inputOne, inputTwo);

            // Assert
            Assert.AreEqual <double>(expected: 0.25, actual: actualSimilarity);
        }
예제 #4
0
        public void GetTextSimilarity_ShouldReturnHalf_WhenInputsHalfSimilarAndSameLength()
        {
            // Arrange
            string inputOne = "tear";
            string inputTwo = "test";

            // Act
            double actualSimilarity = StringCompare.GetTextSimilarity(inputOne, inputTwo);

            // Assert
            Assert.AreEqual <double>(expected: 0.5, actual: actualSimilarity);
        }