public void Create_ProviderIsNullAndSerializerIsNotNull_PropertiesAsExpected() { TestFormatProvider provider = null; TestArgumentSerializer serializer = new TestArgumentSerializer(); Options actual = Options.Create(provider, serializer); Assert.That(actual.Provider, Is.Null); Assert.That(actual.Serializer, Is.SameAs(serializer)); Assert.That(actual.IsLimited, Is.False); Assert.That(actual.Maximum, Is.EqualTo(Int32.MaxValue)); Assert.That(actual.IsFallback, Is.False); Assert.That(actual.Fallback, Is.Null); }
public sbyte ToSByte(IFormatProvider provider) { bool toMinValue = true; if (provider != null) { TestFormatProvider format = provider.GetFormat(typeof(TestFormatProvider)) as TestFormatProvider; if ((format != null) && format.ToSByteMaxValue) { toMinValue = false; } } if (toMinValue) { return(SByte.MinValue); } else { return(SByte.MaxValue); } }
public long ToInt64(IFormatProvider provider) { bool toMinValue = true; if (provider != null) { TestFormatProvider format = provider.GetFormat(typeof(TestFormatProvider)) as TestFormatProvider; if ((format != null) && format.ToInt16MaxValue) { toMinValue = false; } } if (toMinValue) { return(Int64.MinValue); } else { return(Int64.MaxValue); } }