コード例 #1
0
        public void Execute_Delete_Valid_Link()
        {
            var domainId = Guid.NewGuid();
            var domain   = Builder <Domain> .CreateNew()
                           .With(x => x.Id, domainId)
                           .Build();

            Guid linkId      = Guid.NewGuid();
            var  existDbLink = Builder <Repository.Entities.Link> .CreateNew()
                               .With(x => x.Id, linkId)
                               .With(x => x.IsActive, true)
                               .With(x => x.MediaType, MediaType.Music)
                               .With(x => x.Code, "oldcode")
                               .With(x => x.DomainId, domainId)
                               .With(x => x.Domain, domain)
                               .Build();

            var argument = Builder <DeleteLinkArgument> .CreateNew()
                           .With(x => x.LinkId, linkId)
                           .Build();

            var result = _deleteLinkCommand.Execute(argument);

            Assert.IsNotNull(result);
        }
コード例 #2
0
        private void ConfirmDelete(int linkID, string linkTitle)
        {
            var command = new DeleteLinkCommand(Repository, linkID, linkTitle)
            {
                ExecuteSuccessMessage = String.Format(CultureInfo.CurrentCulture, "Link '{0}' deleted", linkTitle)
            };

            Messages.ShowMessage(command.Execute());
            BindList();
        }