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

namespace TestSale
{
    [TestClass]
    public class UnitTest1
    {
         CalcSale cs;
        [TestMethod]
        public void TestMethod1()
        {
            cs = new CalcSale();
            int count = 0;
            decimal cost = 500;
            Assert.AreEqual(0, cs.Calc(count, cost));
        }

        [TestMethod]
        public void TestMethod2()
        {
            cs = new CalcSale();
            int count = 10;
            decimal cost = 500;
            Assert.AreEqual(16, cs.Calc(count, cost));
        }

        [TestMethod]
        public void TestMethod3()
        {
            cs = new CalcSale();
            int count = 10;
            decimal cost = 0.2M;
            Assert.AreEqual(15, cs.Calc(count, cost));
        }

        [TestMethod]
        public void TestMethod4()
        {
            cs = new CalcSale();
            int count = Convert.ToInt32(10*0.5);
            decimal cost = 12;
            Assert.AreEqual(10, cs.Calc(count, cost));
        }

        [TestMethod]
        public void TestMethod5()
        {
            cs = new CalcSale();
            int count = Convert.ToInt32(10 * 0.5);
            decimal cost = 12.21M;
            Assert.AreEqual(10, cs.Calc(count, cost));
        }

        [TestMethod]
        public void TestMethod6()
        {
            cs = new CalcSale();
            int count = Convert.ToInt32(10 * 0.5);
            decimal cost = 12.21M;
            Assert.AreEqual(10, cs.Calc(count, cost*5));
        }

        [TestMethod]
        public void TestMethod7()
        {
            cs = new CalcSale();
            int count = Convert.ToInt32(10 * 0.5);
            decimal cost = 0M;
            Assert.AreEqual(0, cs.Calc(count, cost));
        }

        [TestMethod]
        public void TestMethod8()
        {
            cs = new CalcSale();
            int count = 0;
            decimal cost = 0M;
            Assert.AreEqual(0, cs.Calc(count, cost));
        }

        [TestMethod]
        public void TestMethod9()
        {
            cs = new CalcSale();
            int i = cs.Calc(0, 0M);
            int ii = cs.Calc(2, 0M);
            Assert.AreEqual(i,ii);
        }

        [TestMethod]
        public void TestMethod10()
        {
            cs = new CalcSale();
            int i = cs.Calc(12, 12M);
            int ii = cs.Calc(13, 12M);
            Assert.AreEqual(i, ii);
        }
    }
}
