public void SetsMultipleFormatData() { var connected = new object(); var key1 = new ConnectedDragDropKey <Type>(); var key2 = new ConnectedDragDropKey <Assembly>(); var dragDrop = new ConnectedDragDrop(this._uriDisconnectTable); dragDrop.Drag(connected); dragDrop.SetData(key1, typeof(ConnectedDragDropTests)); dragDrop.SetData(key2, typeof(ConnectedDragDropTests).Assembly); Assert.AreSame(typeof(ConnectedDragDropTests), dragDrop.GetData(key1)); Assert.AreSame(typeof(ConnectedDragDropTests).Assembly, dragDrop.GetData(key2)); }
public void ThrowsExceptionWhenGettingDataForResolvedNotConnected() { var key = new ConnectedDragDropKey <Type>(); var data = typeof(ConnectedDragDropTests); var dragDrop = new ConnectedDragDrop(this._uriDisconnectTable); ExceptionAssert.Throws <InvalidOperationException>(() => dragDrop.GetData(key)); }