GetFormat() public method

Returns an object of the specified type that provides a date and time formatting service.
public GetFormat ( Type formatType ) : object
formatType Type The type of the required formatting service.
return object
        public void PosTest1()
        {
            DateTimeFormatInfo expected = new DateTimeFormatInfo();
            object obj = expected.GetFormat(typeof(DateTimeFormatInfo));

            Assert.True(obj is DateTimeFormatInfo);

            DateTimeFormatInfo actual = obj as DateTimeFormatInfo;
            Assert.Equal(expected, actual);
        }
        public void TestUnsupportedFormatType()
        {
            DateTimeFormatInfo info = new DateTimeFormatInfo();

            Assert.Null(info.GetFormat(typeof(Object)));
        }
 public void GetFormat_UnsupportedFormatType_ReturnsNull()
 {
     DateTimeFormatInfo info = new DateTimeFormatInfo();
     Assert.Null(info.GetFormat(typeof(object)));
 }
 public void GetFormat()
 {
     DateTimeFormatInfo expected = new DateTimeFormatInfo();
     DateTimeFormatInfo format = (DateTimeFormatInfo)expected.GetFormat(typeof(DateTimeFormatInfo));
     Assert.Same(expected, format);
 }