public void SetUp()
        {
            Assert.IsTrue(m_AmxFile.Exists);
            Assert.IsTrue(m_TableFile.Exists);

            m_Environment = new EnvironmentInfo { Culture = "deDE", SenderZipCode = "121" };
            m_Weight = new WeightInfo { WeightUnit = EWeightUnit.TenthGram, WeightValue = 200 };

            m_ExpectedMaximum = TimeSpan.FromMilliseconds(1000);
            m_Watch.Reset();
            m_Watch.Start();
        }
        private void RunStart()
        {
            EnvironmentInfo environment = new EnvironmentInfo { Culture = "deDE", SenderZipCode = "121" };
            WeightInfo weight = new WeightInfo { WeightUnit = EWeightUnit.TenthGram, WeightValue = 200 };
            Assert.That(new FileInfo("Pt2097152.amx").Exists, Is.True);
            Assert.That(new FileInfo("Pt2097152.bin").Exists, Is.True);

            using (var context = new PCalcProxyContext(environment, new FileInfo("Pt2097152.amx").FullName, new FileInfo("Pt2097152.bin").FullName))
            {
                Assert.That(context.Proxy, Is.Not.Null);

                IPCalcProxy proxy = context.Proxy;
                proxy.Start(environment, weight);
            }
        }
 public async Task<PCalcResultInfo> StartCalculation(EnvironmentInfo environment, WeightInfo weight)
 {
     //lookup correct entry
     ScenarioResult initResult = await m_ScenarioRunner.RunAsync(InitFileHandler(environment));
     if (initResult.Success == false || m_Handler.IsValid == false)
     {
         return ReturnErrorResult(initResult);
     }
     ScenarioResult<PCalcResultInfo> startResult = m_ScenarioRunner.Run(() => Start(environment, weight, m_Handler));
     if(startResult.Success == false)
     {
         return ReturnErrorResult(startResult);
     }
     return startResult.Value;
 }
 public async Task<PCalcResultInfo> StartCalculation(EnvironmentInfo environment, WeightInfo weight)
 {
     var result = new PCalcResultInfo();
     result.ProductDescription = new ProductDescriptionInfo()
                                     {
                                         Postage = new PostageInfo() { CurrencySymbol = "$", PostageDecimals = 2, PostageValue = 200 },
                                         ProductCode = 1,
                                         ProductId = 34,
                                         RateVersion = 2007654,
                                         ScaleMode = EScaleMode.NO_SCALE,
                                         State = EProductDescriptionState.Incomplete,
                                         Weight = weight,
                                         WeightClass = 1
                                     };
     DescriptionInfo desc = GetRandomDescription();
     result.QueryType = GetQueryType(desc);
     result.QueryDescription = desc.ToTransferDescription();
     return result;
 }
        private PCalcResultInfo Start(EnvironmentInfo info, WeightInfo weight)
        {
            using (var context = new PCalcProxyContext(info, m_AmxFile.FullName, m_TableFile.FullName))
            {
                IPCalcProxy proxy = context.Proxy;
                Assert.That(proxy, Is.Not.Null);

                return proxy.Start(m_Environment, weight);
            }
        }
 private ScenarioResult<PCalcResultInfo> Start(EnvironmentInfo environment, WeightInfo weight, RateCalculationFileHandler handler)
 {
     using (var context = new PCalcProxyContext(environment, handler.PawnFile, handler.RateTableFile, handler.AdditionalFiles))
     {
         IPCalcProxy proxy = context.Proxy;
         PCalcResultInfo result = proxy.Start(environment, weight);
         HandleCurrencySymbol(result, environment);
         return new ScenarioResult<PCalcResultInfo>() { Value = result };
     }
 }