Beispiel #1
0
        public void VerifyThatDropWorks()
        {
            this.permissionService.Setup(x => x.CanWrite(It.IsAny <ClassKind>(), It.IsAny <Thing>())).Returns(true);
            var vm = new ElementUsageRowViewModel(this.elementUsage, this.option, this.session.Object, null);

            var dropinfo = new Mock <IDropInfo>();

            dropinfo.Setup(x => x.Payload).Returns(this.elementDef3);
            dropinfo.Setup(x => x.Effects).Returns(DragDropEffects.Copy);

            dropinfo.SetupProperty(x => x.Effects);
            vm.Drop(dropinfo.Object).Wait();
            this.session.Verify(x => x.Write(It.IsAny <OperationContainer>()));
        }
        public async Task VerifyThatDropWorks()
        {
            this.permissionService.Setup(x => x.CanWrite(It.IsAny <ClassKind>(), It.IsAny <Thing>())).Returns(true);
            var vm = new ElementUsageRowViewModel(this.elementUsage, this.option, this.session.Object, null);

            var dropinfo = new Mock <IDropInfo>();

            dropinfo.Setup(x => x.Payload).Returns(this.elementDef3);
            dropinfo.Setup(x => x.Effects).Returns(DragDropEffects.Copy);

            dropinfo.SetupProperty(x => x.Effects);
            await vm.Drop(dropinfo.Object);

            this.thingCreator.Verify(x => x.CreateElementUsage(this.elementUsage.ElementDefinition, It.IsAny <ElementDefinition>(), It.IsAny <DomainOfExpertise>(), It.IsAny <ISession>()));
        }