예제 #1
0
		public void CanExtend_CalledAfterDisposed_Throws()
		{
			HotSpotProvider hotSpotProvider = new HotSpotProvider();
			hotSpotProvider.Dispose();
			using (TextBox textBox = new TextBox())
			{
				Assert.Throws<ObjectDisposedException>(() =>
 hotSpotProvider.CanExtend(textBox));
			}
		}
예제 #2
0
		public void SetSite_CalledAfterDisposed_Throws()
		{
			HotSpotProvider hotSpotProvider = new HotSpotProvider();
			hotSpotProvider.Dispose();
			Assert.Throws<ObjectDisposedException>(() =>
			hotSpotProvider.Site = null);
		}
예제 #3
0
		public void GetSite_CalledAfterDisposed_Throws()
		{
			HotSpotProvider hotSpotProvider = new HotSpotProvider();
			hotSpotProvider.Dispose();
			ISite x;
			Assert.Throws<ObjectDisposedException>(() =>
				 x = hotSpotProvider.Site);
		}
예제 #4
0
		public void Dispose_CalledTwice_CallsHandlerOnce()
		{
			HotSpotProvider hotSpotProvider = new HotSpotProvider();
			int disposedCalledCount = 0;
			hotSpotProvider.Disposed += delegate { ++disposedCalledCount; };
			Assert.AreEqual(0, disposedCalledCount);
			hotSpotProvider.Dispose();
			Assert.AreEqual(1, disposedCalledCount);
			hotSpotProvider.Dispose();
			Assert.AreEqual(1, disposedCalledCount);
		}
예제 #5
0
		public void Dispose_HasDisposedEventHandler_CallsHandler()
		{
			HotSpotProvider hotSpotProvider = new HotSpotProvider();
			bool disposedCalled = false;
			hotSpotProvider.Disposed += delegate { disposedCalled = true; };
			Assert.IsFalse(disposedCalled);
			hotSpotProvider.Dispose();
			Assert.IsTrue(disposedCalled);
		}
예제 #6
0
		public void SetEnableHotSpots_CalledAfterDisposed_Throws()
		{
			HotSpotProvider hotSpotProvider = new HotSpotProvider();
			hotSpotProvider.Dispose();
			using (TextBox textBox = new TextBox())
			{
				Assert.Throws<ObjectDisposedException>(() =>
hotSpotProvider.SetEnableHotSpots(textBox, false));
			}
		}