﻿namespace SageOne.IntegrationTests.Factories
{
    using System;
    using System.Linq;
    using System.Collections.Generic;

    using Api.Categories;

    public static class CategoryFactory
    {
        #region Fields

        private static Random random = new Random();

        #endregion Fields

        #region Methods

        public static Category Create()
        {
            return Create(1).First();
        }

        public static Category[] Create(int quantity)
        {
            var itemList = new List<Category>();

            for (int i = 0; i <= quantity - 1; i++)
            {
                var item = new Category
                {
                    Description = random.Generate(15)
                };

                itemList.Add(item);
            }

            return itemList.ToArray();
        }

        #endregion Methods
    }
}
