public void Search_message_would_set_the_endpoint_name()
        {
            var sut = CreateSUT();
            var messageId = "SomeMessageId";
            var receiving = new Endpoint();
            var sending = new Endpoint();
            var msg = new StoredMessage
            {
                MessageId = messageId,
                ReceivingEndpoint = receiving,
                SendingEndpoint = sending,
            };

            sut.SearchByMessageId(msg);

            _eventAggregator.Received(1).Publish(Arg.Is<RequestSelectingEndpoint>(m => m.Endpoint == receiving));
        }
        public void should_load_the_messages_from_the_endpoint()
        {
            var endpoint = new Endpoint { Machine = "localhost", Name = "Service" };
            ServiceControl.GetAuditMessages(Arg.Is(endpoint), Arg.Any<string>(), Arg.Any<int>(), Arg.Any<string>(), Arg.Any<bool>())
                             .Returns(x => Task.Run(() => new PagedResult<StoredMessage>
                             {
                                 CurrentPage = 1,
                                 TotalCount = 100,
                                 Result = new List<StoredMessage>
                                 {
                                     new StoredMessage(),
                                     new StoredMessage()
                                 }
                             }));

            AsyncHelper.Run(() => MessageList.Handle(new SelectedExplorerItemChanged(new AuditEndpointExplorerItem(endpoint))));

            EventAggregator.Received(1).Publish(Arg.Any<WorkStarted>());
            EventAggregator.Received(1).Publish(Arg.Any<WorkFinished>());
            MessageList.Messages.Count.ShouldBe(2);
            SearchBar.IsVisible.ShouldBe(true);
        }
Ejemplo n.º 3
0
 protected bool Equals(Endpoint other)
 {
     return string.Equals(Address, other.Address);
 }
 protected EndpointExplorerItem(Endpoint endpoint) : base(endpoint.Name)
 {
     Endpoint = endpoint;
 }
 public ErrorEndpointExplorerItem(Endpoint endpoint)
     : base(endpoint)
 {
 }
 public AuditEndpointExplorerItem(Endpoint endpoint) : base(endpoint)
 {
 }
 public RequestSelectingEndpoint(Endpoint endpoint)
 {
     Endpoint = endpoint;
 }
 public bool EndpointExists(Endpoint endpoint)
 {
     return Children.OfType<EndpointExplorerItem>()
                    .Any(item => item.Endpoint == endpoint);
 }
 public EndpointExplorerItem GetEndpointNode(Endpoint endpoint)
 {
     return Children.OfType<EndpointExplorerItem>()
                    .First(item => item.Endpoint == endpoint);
 }