Beispiel #1
0
        public void ShouldNotAllowToDragOverItemsAtStartOrEndOfCollection(int index)
        {
            // Given
            var dropInfo = new TestDropInfo {
                Data = new TwoPointNonUniformityCorrectionTemplate(), TargetCollection = new object[3], InsertIndex = index
            };

            var dropHandler = new ProcessingChainDropHandler();

            // When
            dropHandler.DragOver(dropInfo);

            // Then
            Assert.AreEqual(DragDropEffects.None, dropInfo.Effects);
        }
Beispiel #2
0
        public void ShouldNotAllowToDragOverItemsOtherThanImageProcessingAlgorithmTemplates(Type elementType, bool shouldAllowToDragOver)
        {
            // Given
            var dropInfo = new TestDropInfo
            {
                Data             = elementType.GetConstructor(Type.EmptyTypes)?.Invoke(null),
                TargetCollection = new object[3],
                DragInfo         = new TestDragInfo {
                    SourceCollection = new object[3]
                },
                InsertIndex = 1
            };

            var dropHandler = new ProcessingChainDropHandler();

            // When
            dropHandler.DragOver(dropInfo);

            // Then
            Assert.AreEqual(shouldAllowToDragOver, dropInfo.Effects != DragDropEffects.None);
        }