public void GetObjectDataNullTest() { var sut = new ValidationException("message") { ResourceReferenceProperty = "MyReferenceProperty" }; Assert.Throws <ArgumentNullException>(() => sut.GetObjectData(null, new StreamingContext())); }