Exemplo n.º 1
0
        public void VerifyThatDropParameterTypeWorks()
        {
            var containerRow = new RequirementsSpecificationRowViewModel(this.spec1, this.session.Object, null);

            var param    = new BooleanParameterType();
            var tuple    = new Tuple <ParameterType, MeasurementScale>(param, null);
            var dropinfo = new Mock <IDropInfo>();

            dropinfo.Setup(x => x.Payload).Returns(tuple);

            containerRow.Drop(dropinfo.Object);
            this.session.Verify(x => x.Write(It.IsAny <OperationContainer>()));
        }
Exemplo n.º 2
0
        public void VerifyRequirementDrop()
        {
            var dropInfo = new Mock <IDropInfo>();

            dropInfo.Setup(x => x.Payload).Returns(this.req);
            dropInfo.Setup(x => x.Effects).Returns(DragDropEffects.Move);
            var row = new RequirementsSpecificationRowViewModel(this.reqSpec, this.session.Object, null);

            Assert.AreEqual(1, this.reqSpec.Requirement.Count);

            row.Drop(dropInfo.Object);

            this.session.Verify(x => x.Write(It.IsAny <OperationContainer>()), Times.Exactly(1));
        }
Exemplo n.º 3
0
        public void VerifyRequirementGroupDrop()
        {
            var dropInfo = new Mock <IDropInfo>();

            dropInfo.Setup(x => x.Payload).Returns(this.grp1);
            dropInfo.Setup(x => x.Effects).Returns(DragDropEffects.Move);
            dropInfo.Setup(x => x.KeyStates).Returns(DragDropKeyStates.LeftMouseButton);

            var row = new RequirementsSpecificationRowViewModel(this.spec1, this.session.Object, this.requirementBrowserViewModel);

            row.IsParametricConstraintDisplayed  = true;
            row.IsSimpleParameterValuesDisplayed = true;

            Assert.AreEqual(0, this.spec1.Group.Count);
            Assert.AreEqual(5, row.ContainedRows.Count);

            row.Drop(dropInfo.Object);

            this.session.Verify(x => x.Write(It.IsAny <OperationContainer>()), Times.Exactly(1));
        }