Example #1
0
        public void FormatUnexpectedDataType_MyClass_Assert()
        {
            CompassPointFormatInfo info = new CompassPointFormatInfo();

            string result = string.Format(info, "{0:XYZ}", new MyClass());

            Assert.AreEqual(typeof(MyClass).FullName, result);
        }
Example #2
0
        public void FormatUnexpectedDataType_POCO_Assert()
        {
            int value = 12;
            CompassPointFormatInfo info = new CompassPointFormatInfo();

            string result = string.Format(info, "{0:XYZ}", value);

            Assert.AreEqual("XYZ", result);
        }
Example #3
0
        public void ToCompassPoint_SecondaryIntercardinal_Assert()
        {
            var degrees = 21.5;
            DegreeMinuteSecond subject  = new DegreeMinuteSecond(degrees);
            IFormatProvider    provider = new CompassPointFormatInfo(CompassPointPrecision.SecondaryIntercardinal);

            string result = subject.ToCompassPoint(provider);

            Assert.AreEqual("NNE", result);
        }