Ejemplo n.º 1
0
        public void HandleInvalidModel()
        {
            var convertModel = new ConvertModel(1, "aa", "bb");
            var results      = UnitHandler.Convert(convertModel);

            Assert.AreEqual(0, results.Count());
        }
Ejemplo n.º 2
0
        public void HandlesNanometerToParsec()
        {
            var convertModel = new ConvertModel(1, "nanometer", "parsec");
            var result       = UnitHandler.Convert(convertModel).Single();
            var str          = result.ToString(System.Globalization.CultureInfo.InvariantCulture);

            Assert.AreEqual(3.2408000000000005E-26, result.ConvertedValue);
            Assert.AreEqual("3.2408e-26 parsec", str);
        }
Ejemplo n.º 3
0
        public void HandlesParsecToNanometer()
        {
            var convertModel = new ConvertModel(1, "parsec", "nanometer");
            var result       = UnitHandler.Convert(convertModel).Single();
            var str          = result.ToString(System.Globalization.CultureInfo.InvariantCulture);

            Assert.AreEqual(3.0857000000000004E+25, result.ConvertedValue);
            Assert.AreEqual("3.0857e+25 nanometer", str);
        }