public static JmOptionDomain CreateOption <T>(this T value, decimal price, JmUnitTypes unitType)
     where T : Enum
 {
     return(CreateOption(value,
                         price,
                         unitType,
                         JmOperationTypes.Hand | JmOperationTypes.Motor));
 }
 public static JmOptionDomain CreateOption <T>(this T value,
                                               decimal price,
                                               JmUnitTypes unitType,
                                               JmOperationTypes operationTypes)
     where T : Enum
 {
     return(new JmOptionDomain
     {
         Name = Enum.GetName(typeof(T), value),
         Type = typeof(T).FullName,
         UnitType = unitType,
         Price = price,
         OperationType = operationTypes
     });
 }
        public async void Should_ReturnPrices(int height, int width, JmUnitTypes type)
        {
            //var repository = new JmPriceRepository(() => new MongoDbPriceDataStorage(new JmCalculatorConfig
            //{
            //    ConnectionString = "",
            //    Name = "test"
            //}));
            var price = await _repository.GetAsync(new JmPriceRequest
            {
                Height   = height,
                UnitType = type,
                Width    = width
            });

            int index = (width - 500) / 100;

            Assert.NotNull(price);

            Assert.NotEmpty(price.Values);

            Assert.InRange(index + 1, 1, price.Values.Length);

            Assert.NotEqual(0, price.Values[index]);
        }