GetDouble() public method

public GetDouble ( string key ) : double
key string
return double
コード例 #1
0
 public void SetGetDouble()
 {
     QuickFix.Dictionary d = new QuickFix.Dictionary();
     d.SetDouble("DOUBLEKEY1", 12.3);
     d.SetDouble("DOUBLEKEY2", 987362.987362);
     d.SetString("BADDOUBLEKEY", "AB12.3");
     Assert.That(d.GetDouble("DOUBLEKEY1"), Is.EqualTo(12.3));
     Assert.That(d.GetDouble("DOUBLEKEY2"), Is.EqualTo(987362.987362));
     Assert.Throws <ConfigError>(delegate { d.GetDouble("DOUBLEKEY3"); });
     Assert.Throws <ConfigError>(delegate { d.GetDouble("BADDOUBLEKEY"); });
 }
コード例 #2
0
ファイル: DictionaryTest.cs プロジェクト: nisbus/quickfixn
 public void SetGetDouble()
 {
     QuickFix.Dictionary d = new QuickFix.Dictionary();
     d.SetDouble("DOUBLEKEY1", 12.3);
     d.SetDouble("DOUBLEKEY2", 987362.987362);
     d.SetString("BADDOUBLEKEY", "AB12.3");
     Assert.That(d.GetDouble("DOUBLEKEY1"), Is.EqualTo(12.3));
     Assert.That(d.GetDouble("DOUBLEKEY2"), Is.EqualTo(987362.987362));
     Assert.Throws<ConfigError>(delegate { d.GetDouble("DOUBLEKEY3"); });
     Assert.Throws<ConfigError>(delegate { d.GetDouble("BADDOUBLEKEY"); });
 }
コード例 #3
0
        public void GetDouble()
        {
            // make sure that QF/n uses the invariant culture, no matter what the current culture is
            System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("fr-FR");

            QuickFix.Dictionary d = new QuickFix.Dictionary();
            d.SetString("DOUBLEKEY1", "12.3");
            d.SetString("DOUBLEKEY2", "987362.987362");
            d.SetString("BADDOUBLEKEY", "AB12.3");
            d.SetString("FOREIGNFORMAT", "44,44");

            Assert.That(d.GetDouble("DOUBLEKEY1"), Is.EqualTo(12.3));
            Assert.That(d.GetDouble("DOUBLEKEY2"), Is.EqualTo(987362.987362));
            Assert.Throws <ConfigError>(delegate { d.GetDouble("DOUBLEKEY3"); });
            Assert.Throws <ConfigError>(delegate { d.GetDouble("BADDOUBLEKEY"); });
            Assert.Throws <ConfigError>(delegate { d.GetDouble("BADDOUBLEKEY"); });
        }
コード例 #4
0
        public void GetDouble()
        {
            // make sure that QF/n uses the invariant culture, no matter what the current culture is
            System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("fr-FR");

            QuickFix.Dictionary d = new QuickFix.Dictionary();
            d.SetString("DOUBLEKEY1", "12.3");
            d.SetString("DOUBLEKEY2", "987362.987362");
            d.SetString("BADDOUBLEKEY", "AB12.3");
            d.SetString("FOREIGNFORMAT", "44,44");

            Assert.That(d.GetDouble("DOUBLEKEY1"), Is.EqualTo(12.3));
            Assert.That(d.GetDouble("DOUBLEKEY2"), Is.EqualTo(987362.987362));
            Assert.Throws<ConfigError>(delegate { d.GetDouble("DOUBLEKEY3"); });
            Assert.Throws<ConfigError>(delegate { d.GetDouble("BADDOUBLEKEY"); });
            Assert.Throws<ConfigError>(delegate { d.GetDouble("BADDOUBLEKEY"); });
        }