public void VerifyThatDragOverWorksWithoutDropTarget() { var vm = new ElementDefinitionsBrowserViewModel(this.iteration, this.session.Object, null, null, null, null, null, null); var dropinfo = new Mock <IDropInfo>(); dropinfo.Setup(x => x.Payload).Returns(this.elementDef); dropinfo.SetupProperty(x => x.Effects); dropinfo.Object.Effects = DragDropEffects.All; vm.DragOver(dropinfo.Object); Assert.AreNotEqual(DragDropEffects.All, dropinfo.Object.Effects); }
public void VerifyThatDragOverWorksWithDropTarget() { var vm = new ElementDefinitionsBrowserViewModel(this.iteration, this.session.Object, null, null, null, null, null, null); var dropinfo = new Mock <IDropInfo>(); var target = new Mock <IDropTarget>(); dropinfo.Setup(x => x.TargetItem).Returns(target.Object); dropinfo.SetupProperty(x => x.Effects); vm.DragOver(dropinfo.Object); target.Verify(x => x.DragOver(dropinfo.Object)); }
public void VerifyThatParticipantWithoutDomainSelectedCannotDropOnElementDefBrowser() { var vm = new ElementDefinitionsBrowserViewModel(this.iteration, this.session.Object, null, null, null, null, null, null); var simpleQuantityKind = new SimpleQuantityKind(Guid.NewGuid(), this.assembler.Cache, this.uri); var ratioScale = new RatioScale(Guid.NewGuid(), this.assembler.Cache, this.uri); simpleQuantityKind.DefaultScale = ratioScale; var payload = new Tuple <ParameterType, MeasurementScale>(simpleQuantityKind, ratioScale); var dropInfo = new Mock <IDropInfo>(); dropInfo.Setup(x => x.Payload).Returns(payload); dropInfo.SetupProperty(x => x.Effects); vm.DragOver(dropInfo.Object); Assert.AreEqual(dropInfo.Object.Effects, DragDropEffects.None); }
public void VerifyThatDragOverWorksWithoutDropTarget() { var vm = new ElementDefinitionsBrowserViewModel(this.iteration, this.session.Object, null, null, null, null); var dropinfo = new Mock <IDropInfo>(); this.session.Setup(x => x.OpenIterations) .Returns(new Dictionary <Iteration, Tuple <DomainOfExpertise, Participant> > { { this.iteration, new Tuple <DomainOfExpertise, Participant>(new DomainOfExpertise(), null) } }); dropinfo.Setup(x => x.Payload).Returns(this.elementDef); dropinfo.SetupProperty(x => x.Effects); dropinfo.Object.Effects = DragDropEffects.All; vm.DragOver(dropinfo.Object); Assert.AreNotEqual(DragDropEffects.All, dropinfo.Object.Effects); }
public void VerifyThatDragOverWorksWithDropTarget() { var vm = new ElementDefinitionsBrowserViewModel(this.iteration, this.session.Object, null, null, null, null); var dropinfo = new Mock <IDropInfo>(); this.session.Setup(x => x.OpenIterations) .Returns(new Dictionary <Iteration, Tuple <DomainOfExpertise, Participant> > { { this.iteration, new Tuple <DomainOfExpertise, Participant>(new DomainOfExpertise(), null) } }); var target = new Mock <IDropTarget>(); dropinfo.Setup(x => x.TargetItem).Returns(target.Object); dropinfo.SetupProperty(x => x.Effects); vm.DragOver(dropinfo.Object); target.Verify(x => x.DragOver(dropinfo.Object)); }