﻿using GarminFmiLib;
using NUnit.Framework;

namespace GDISharpUnitTest
{
    public class PacketIDGeneratorUnitTest
    {
        [Test]
        public void Next_SubsequentCalls_ReturnDifferentNumber()
        {
            var gen = new SerialPacketIDGenerator();

            var seq0 = gen.Next();
            var seq1 = gen.Next();
            var seq2 = gen.Next();
            var seq3 = gen.Next();

            Assert.IsTrue(seq0 < seq1);
            Assert.IsTrue(seq1 < seq2);
            Assert.IsTrue(seq2 < seq3);
        }

        [Test]
        public void Next_Initialized_ReturnsIncrement()
        {
            var start = 42;
            var gen = new SerialPacketIDGenerator(start);

            var seq0 = gen.Next();

            Assert.AreEqual(start + 1, seq0);
        }
    }
}