using System;
using EditDistanceLibrary;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace UnitTestProject1
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void Distance_Insert_End()
        {
            //arrange
            string str1 = "стол";
            string str2 = "столы";
            int expected = 1;

            //act
            EditDistance d = new EditDistance();
            int actual = d.Distance(str1, str2);

            //assert
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        public void Distance_Insert_End_2()
        {
            //arrange
            string str1 = "стул";
            string str2 = "стулья";
            int expected = 2;

            //act
            EditDistance d = new EditDistance();
            int actual = d.Distance(str1, str2);

            //assert
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        public void Distance_Replace_Middle()
        {
            //arrange
            string str1 = "стол";
            string str2 = "стул";
            int expected = 1;

            //act
            EditDistance d = new EditDistance();
            int actual = d.Distance(str1, str2);

            //assert
            Assert.IsTrue(expected == actual, "Вспомогательное сообщение: expected == actual");
        }

        [TestMethod]
        public void Error_Test()
        {
            //arrange
            string str1 = "стол";
            string str2 = "стул";
            int expected = 11;

            //act
            EditDistance d = new EditDistance();
            int actual = d.Distance(str1, str2);

            //assert
            Assert.AreEqual(expected, actual);
        }

    }
}
