Esempio n. 1
0
        public void GetDouble()
        {
            Double value, defaultValue;

            defaultValue = 53545.543;
            try
            {
                SpeciesFactManager.AddUserSelectedSpeciesFacts(GetContext(), SpeciesFactManagerTest.GetSomeSpeciesFactIds(GetContext()), UserSelectedSpeciesFactUsage.Output);
                using (DataReader dataReader = DataServer.GetSpeciesFactsById(GetContext()))
                {
                    while (dataReader.Read())
                    {
                        if (dataReader.IsDBNull(SpeciesFactData.FIELD_VALUE_1))
                        {
                            value = dataReader.GetDouble(SpeciesFactData.FIELD_VALUE_1, defaultValue);
                            Assert.AreEqual(value, defaultValue);
                        }
                        else
                        {
                            value = dataReader.GetDouble(SpeciesFactData.FIELD_VALUE_1);
                            Assert.AreNotEqual(value, defaultValue);
                            value = dataReader.GetDouble(SpeciesFactData.FIELD_VALUE_1, defaultValue);
                            Assert.AreNotEqual(value, defaultValue);
                        }
                    }
                }
            }
            finally
            {
                SpeciesFactManager.DeleteUserSelectedSpeciesFacts(GetContext());
            }
        }
Esempio n. 2
0
 public void GetDoubleColumnNameError()
 {
     try
     {
         SpeciesFactManager.AddUserSelectedSpeciesFacts(GetContext(), SpeciesFactManagerTest.GetSomeSpeciesFactIds(GetContext()), UserSelectedSpeciesFactUsage.Output);
         using (DataReader dataReader = DataServer.GetSpeciesFactsById(GetContext()))
         {
             Assert.IsTrue(dataReader.Read());
             dataReader.GetDouble("No column name");
         }
     }
     finally
     {
         SpeciesFactManager.DeleteUserSelectedSpeciesFacts(GetContext());
     }
 }