public void Calculate_Expression_TargetValue(string text, double value)
 {
     var linkedLibraryFactory = new StaticLinkedLibraryFactory(typeof(StandardProcessorBuilder.LinkedMath));
     var processorFactory = new StandardProcessorFactory(linkedLibraryFactory);
     var processor = processorFactory.CreateProcessor();
     Assert.That(processor.Calculate(text), Is.EqualTo(value).Within(1e-7));
 }
 public void Calculate_BigNumber_OverFlowExcelption(string text)
 {
     var linkedLibraryFactory = new StaticLinkedLibraryFactory(typeof(StandardProcessorBuilder.LinkedMath));
     var processorFactory = new StandardProcessorFactory(linkedLibraryFactory);
     var processor = processorFactory.CreateProcessor();
     processor.Calculate(text);
 }
        public void ProcessorBuilder_SomeLibraryFactory_NotNull()
        {
            var linkedLibrary = MockRepository.GenerateStub<ILinkedLibrary>();
            var linkedLibraryFactory = MockRepository.GenerateStub<ILinkedLibraryFactory>();
            linkedLibraryFactory.Stub(lf => lf.CreateLinkedLibrary()).Return(linkedLibrary);

            var processorFactory = new StandardProcessorFactory(linkedLibraryFactory);
            Assert.That(processorFactory.ProcessorBuilder, Is.Not.Null);
        }
 public void GivenIHaveStandardProcessorWithStandartRules()
 {
     var linkedLibraryFactory = new StaticLinkedLibraryFactory(typeof (StandardProcessorBuilder.LinkedMath));
     var processorFactory = new StandardProcessorFactory(linkedLibraryFactory);
     Processor = processorFactory.CreateProcessor();
 }