public void FormatUnexpectedDataType_MyClass_Assert() { LongitudeFormatInfo info = new LongitudeFormatInfo(); string result = string.Format(info, "{0:XYZ}", new MyClass()); Assert.AreEqual(typeof(MyClass).FullName, result); }
public void FormatUnexpectedDataType_POCO_Assert() { int value = 12; LongitudeFormatInfo info = new LongitudeFormatInfo(); string result = string.Format(info, "{0:XYZ}", value); Assert.AreEqual("XYZ", result); }
public void ToLongitude_Provider_Format_Assert() { var degrees = 41.79620158; string format = "dms5"; IFormatProvider provider = new LongitudeFormatInfo(); DegreeMinuteSecond subject = new DegreeMinuteSecond(degrees); string result = subject.ToLongitude(provider, format); Assert.AreEqual("041° 47' 46.32569'' E", result); }
public void ToLongitude_Provider_Assert() { var degrees = 41.79620158; LongitudeFormatInfo provider = new LongitudeFormatInfo(); provider.Separator = "-"; DegreeMinuteSecond subject = new DegreeMinuteSecond(degrees); string result = subject.ToLongitude(provider); Assert.AreEqual("041°-47'-46''-E", result); }