public void OpenOpenFails()
        {
            ExtCommObj obj = new ExtCommObj();

            obj.Open();
            obj.Open();
        }
        public void OpenClosedItemFails()
        {
            ExtCommObj obj = new ExtCommObj();

            obj.Open();
            obj.Close();
            obj.Open();
        }
        public void OpenFaulted()
        {
            ExtCommObj obj = new ExtCommObj();

            obj.XFault();
            obj.Open();
        }
        public void CloseFaulted()
        {
            ExtCommObj obj = new ExtCommObj();

            obj.Open();
            obj.XFault();
            obj.Close();
        }
        public void CloseAtOpenedState()
        {
            ExtCommObj obj = new ExtCommObj();

            obj.Open();
            obj.Close(); // Aborted() is *not* called.
            Assert.IsFalse(obj.Aborted, "#1");
            Assert.IsTrue(obj.Closed, "#2");
        }
        public void Fault()
        {
            ExtCommObj obj = new ExtCommObj();

            obj.XFault();

            obj = new ExtCommObj();
            obj.Open();
            obj.XFault();
            Assert.AreEqual(CommunicationState.Faulted, obj.State, "#1");
            Assert.AreEqual(false, obj.IsDisposed, "#2");
        }
        public void AbortFaulted()
        {
            ExtCommObj obj = new ExtCommObj();

            obj.Open();
            obj.XFault();
            Assert.AreEqual(CommunicationState.Faulted, obj.State, "#1");
            obj.Abort(); // does not raise an error
            Assert.AreEqual(CommunicationState.Closed, obj.State, "#2");
            Assert.IsTrue(obj.Aborted, "#3");
            Assert.IsFalse(obj.Closed, "#4");
            obj.Abort(); // does not raise an error!
        }
        public void OpenClose()
        {
            ExtCommObj obj = new ExtCommObj();

            Assert.AreEqual(CommunicationState.Created, obj.State, "#1");
            obj.Open();
            Assert.AreEqual(CommunicationState.Opened, obj.State, "#2");
            Assert.IsTrue(obj.Opened, "#2-2");
            obj.Close();
            Assert.AreEqual(CommunicationState.Closed, obj.State, "#3");
            Assert.IsTrue(obj.Closed, "#3-2");
            Assert.AreEqual(true, obj.IsDisposed, "#4");
        }
		public void AbortFaulted ()
		{
			ExtCommObj obj = new ExtCommObj ();
			obj.Open ();
			obj.XFault ();
			Assert.AreEqual (CommunicationState.Faulted, obj.State, "#1");
			obj.Abort (); // does not raise an error
			Assert.AreEqual (CommunicationState.Closed, obj.State, "#2");
			Assert.IsTrue (obj.Aborted, "#3");
			Assert.IsFalse (obj.Closed, "#4");
			obj.Abort (); // does not raise an error!
		}
		public void OpenFaulted ()
		{
			ExtCommObj obj = new ExtCommObj ();
			obj.XFault ();
			obj.Open ();
		}
		public void CloseFaulted ()
		{
			ExtCommObj obj = new ExtCommObj ();
			obj.Open ();
			obj.XFault ();
			obj.Close ();
		}
		public void Fault ()
		{
			ExtCommObj obj = new ExtCommObj ();
			obj.XFault ();

			obj = new ExtCommObj ();
			obj.Open ();
			obj.XFault ();
			Assert.AreEqual (CommunicationState.Faulted, obj.State, "#1");
			Assert.AreEqual (false, obj.IsDisposed, "#2");
		}
		public void OpenClosedItemFails ()
		{
			ExtCommObj obj = new ExtCommObj ();
			obj.Open ();
			obj.Close ();
			obj.Open ();
		}
		public void CloseAtOpenedState ()
		{
			ExtCommObj obj = new ExtCommObj ();
			obj.Open ();
			obj.Close (); // Aborted() is *not* called.
			Assert.IsFalse (obj.Aborted, "#1");
			Assert.IsTrue (obj.Closed, "#2");
		}
		public void OpenOpenFails ()
		{
			ExtCommObj obj = new ExtCommObj ();
			obj.Open ();
			obj.Open ();
		}
		public void OpenClose ()
		{
			ExtCommObj obj = new ExtCommObj ();
			Assert.AreEqual (CommunicationState.Created, obj.State, "#1");
			obj.Open ();
			Assert.AreEqual (CommunicationState.Opened, obj.State, "#2");
			Assert.IsTrue (obj.Opened, "#2-2");
			obj.Close ();
			Assert.AreEqual (CommunicationState.Closed, obj.State, "#3");
			Assert.IsTrue (obj.Closed, "#3-2");
			Assert.AreEqual (true, obj.IsDisposed, "#4");
		}