public void ConstructorArgumentNullException2Test() { FieldInfo info = typeof(int).GetField("MinValue"); Assert.IsNotNull(info); NuGenFieldInfo fieldInfo = new NuGenFieldInfo(info, null); }
public void FieldAccessTest() { Int32 privateFieldValue = _invoker.Fields["_privateField"].GetValue <Int32>(); Assert.AreEqual(_fooValue, privateFieldValue); ParentClass parentClass = new ParentClass(); NuGenInvoker invoker = new NuGenInvoker(parentClass); NuGenFieldInfo privateFieldInfo = invoker.Fields["privateField"]; Assert.IsNotNull(privateFieldInfo); }
/// <summary> /// Initializes a new instance of the <see cref="NuGenPropertyGrid"/> class. /// </summary> /// <param name="serviceProvider"> /// Provides:<para/> /// <see cref="INuGenControlStateService"/><para/> /// <see cref="INuGenPropertyGridRenderer"/><para/> /// </param> /// <exception cref="ArgumentNullException"> /// <para><paramref name="serviceProvider"/> is <see langword="null"/>.</para> /// </exception> public NuGenPropertyGrid(INuGenServiceProvider serviceProvider) { if (serviceProvider == null) { throw new ArgumentNullException("serviceProvider"); } _serviceProvider = serviceProvider; this.ToolStripRenderer = new ToolStripProfessionalRenderer(new NuGenVisualStudioColorTable()); NuGenInvoker invoker = new NuGenInvoker(this); _doccomment = invoker.Fields["doccomment"]; _doccomment.Events["Paint"].AddHandler(new PaintEventHandler(this.doccomment_Paint)); _doccomment.Fields["m_labelDesc"].Properties["BackColor"].SetValue(Color.Transparent); _doccomment.Fields["m_labelTitle"].Properties["BackColor"].SetValue(Color.Transparent); }
public void ConstructorArgumentNullExceptionTest() { NuGenFieldInfo fieldInfo = new NuGenFieldInfo(null, new object()); }
public void ArgumentNullException2Test() { NuGenFieldInfo fieldInfo = _fields[""]; }
public void FieldNotFoundExceptionTest() { NuGenFieldInfo fieldInfo = _fields["MethodNotExist"]; }