public void ReturnTrue_GivenValidLength(Type outputType, byte length) { var bytes = new byte[30]; var valueReader = new DhcpBinaryValue(bytes, 0, length); Assert.True(valueReader.IsValid(outputType)); }
public void ThrowNotSupportedExceptionWithHints_GivenUnsupportedType(Type type) { var bytes = new byte[10]; var valueReader = new DhcpBinaryValue(bytes, 0, 10); var ex = Assert.Throws <NotSupportedException>( () => valueReader.IsValid(type)); Assert.Contains("types", ex.Message); Assert.Contains("Int32", ex.Message); Assert.Contains("Int16", ex.Message); }