示例#1
0
        public void ToStringShouldWork(double value, string expected)
        {
            var original = new RelativeHumidity(value);
            var actual = original.ToString();

            Assert.That(actual, Is.EqualTo(expected));
        }
示例#2
0
        public static IHumidity Parse(double value, string type)
        {
            IHumidity result;

            switch (type.ToLower())
            {
                case "%":
                case "percent":
                    result = new RelativeHumidity(value);
                    break;

                default:
                    throw new Exception("Could not determine type " + type);
            }

            return result;
        }