using Microsoft.VisualStudio.TestTools.UnitTesting;
using TerminalKFC.Windows;
using System.Windows;
using System.Windows.Controls;

namespace UnitTestProject
{
    [TestClass]
    public class UnitTest1
    {
        Window2 wnd = new Window2();

        [TestMethod]
        public void SumTest()
        {
            int sum, price, expectedSum, resultSum;

            // 1
            sum = 200;
            price = 70;

            expectedSum = 270;
            resultSum = wnd.GetNewSum(sum, price);

            Assert.AreEqual(expectedSum, resultSum);

            // 2
            sum = 0;
            price = 200;

            expectedSum = 200;
            resultSum = wnd.GetNewSum(sum, price);

            Assert.AreEqual(expectedSum, resultSum);

            // 3
            sum = 200;
            price = 100;

            expectedSum = 300;
            resultSum = wnd.GetNewSum(sum, price);

            Assert.AreEqual(expectedSum, resultSum);

            // 4
            sum = 300;
            price = 150;

            expectedSum = 450;
            resultSum = wnd.GetNewSum(sum, price);

            Assert.AreEqual(expectedSum, resultSum);

            // 5
            sum = 450;
            price = 200;

            expectedSum = 650;
            resultSum = wnd.GetNewSum(sum, price);

            Assert.AreEqual(expectedSum, resultSum);
        }

        [TestMethod]
        public void BurgerTest()
        {
            wnd.AddNewProduct("Шефбургер\t\t\t100 p.");
            StringAssert.Contains(wnd.bracket, "Шефбургер\t\t\t100 p.");
        }

        [TestMethod]
        public void PonchickTest()
        {
            wnd.AddNewProduct("Пончик\t\t\t\t200 p.");
            StringAssert.Contains(wnd.bracket, "Пончик\t\t\t\t200 p.");
        }

        [TestMethod]
        public void BigPirogTest()
        {
            wnd.AddNewProduct("Пирог\t\t\t\t150 p.");
            StringAssert.Contains(wnd.bracket, "Пирог\t\t\t\t150 p.");
        }

        [TestMethod]
        public void SmallPirogTest()
        {
            wnd.AddNewProduct("Пирожок\t\t\t70 p.");
            StringAssert.Contains(wnd.bracket, "Пирожок\t\t\t70 p.");
        }
    }
}