public void Dispose() { CloneResourceSet rs = new CloneResourceSet(new ClonableObject()); rs.Dispose(); rs.Dispose(); }
public void GetString_Disposed() { CloneResourceSet rs = new CloneResourceSet(new ClonableObject()); rs.Dispose(); try { rs.GetString("doesnotexists"); Assert.Fail("#1"); } catch (ObjectDisposedException ex) { // Cannot access a closed resource set Assert.AreEqual(typeof(ObjectDisposedException), ex.GetType(), "#2"); Assert.IsNull(ex.InnerException, "#3"); Assert.IsNotNull(ex.Message, "#4"); } }
public void GetEnumerator_Disposed() { CloneResourceSet rs = new CloneResourceSet(new ClonableObject()); rs.Dispose(); try { rs.GetEnumerator(); Assert.Fail("#1"); #if NET_2_0 } catch (ObjectDisposedException ex) { // Cannot access a closed resource set Assert.AreEqual(typeof(ObjectDisposedException), ex.GetType(), "#2"); Assert.IsNull(ex.InnerException, "#3"); Assert.IsNotNull(ex.Message, "#4"); } #else } catch (InvalidOperationException ex) {
public void GetString_Disposed () { CloneResourceSet rs = new CloneResourceSet (new ClonableObject ()); rs.Dispose (); try { rs.GetString ("doesnotexists"); Assert.Fail ("#1"); } catch (ObjectDisposedException ex) { // Cannot access a closed resource set Assert.AreEqual (typeof (ObjectDisposedException), ex.GetType (), "#2"); Assert.IsNull (ex.InnerException, "#3"); Assert.IsNotNull (ex.Message, "#4"); } }
public void Dispose () { CloneResourceSet rs = new CloneResourceSet (new ClonableObject ()); rs.Dispose (); rs.Dispose (); }
public void GetEnumerator_Disposed () { CloneResourceSet rs = new CloneResourceSet (new ClonableObject ()); rs.Dispose (); try { rs.GetEnumerator (); Assert.Fail ("#1"); #if NET_2_0 } catch (ObjectDisposedException ex) { // Cannot access a closed resource set Assert.AreEqual (typeof (ObjectDisposedException), ex.GetType (), "#2"); Assert.IsNull (ex.InnerException, "#3"); Assert.IsNotNull (ex.Message, "#4"); } #else } catch (InvalidOperationException ex) {