﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using Xna2DLib.Animations.Evaluators;
using System;

namespace UnitTestProject1.AnimationsTests.EvaluatorTests
{
    [TestClass]
    public class IntEvaluatortester
    {
        [TestMethod]
        public void Normal()
        {
            IntEvaluator testEvaluator = new IntEvaluator();

            int result = testEvaluator.Evaluate(.5f, 0, 10);

            Assert.AreEqual(result, 5);
        }

        [TestMethod]
        public void Negative()
        {
            IntEvaluator testEvaluator = new IntEvaluator();

            int result = testEvaluator.Evaluate(.6f, -5, 7);

            Assert.AreEqual(result, 2);
        }

        [TestMethod]
        public void ReverseValues()
        {
            IntEvaluator testEvaluator = new IntEvaluator();

            int result = testEvaluator.Evaluate(.5f, 100, 0);

            Assert.AreEqual(result, 50);
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentException))]
        public void BadFraction()
        {
            IntEvaluator testEvaluator = new IntEvaluator();
            testEvaluator.Evaluate(-.5f, 0, 10);
            testEvaluator.Evaluate(1.5f, 0, 10);
        }
    }
}
