public void Generate()
        {
            List<AvailableChannel> availableChannels=new List<AvailableChannel>();
            AvailableChannel availableChannel= new AvailableChannel();
            availableChannel.PublisherInfo= new MapChannelComponent();
            availableChannel.PublisherInfo.Port = 0;
            availableChannel.PublisherInfo.InstanceName = "IPublisher.Local";
            availableChannel.Status = Status.NotChecked;
            availableChannel.SubscriberInfo= new MapChannelComponent();
            availableChannel.SubscriberInfo.Port = 0;
            availableChannel.SubscriberInfo.InstanceName = "ISubscriber.Local";
            availableChannels.Add(availableChannel);

            XmlSerializer xmlSerializer= new XmlSerializer(typeof(List<AvailableChannel>));
            using (FileStream fs = new FileStream("distributormap.xml", FileMode.Create))
                xmlSerializer.Serialize(fs, availableChannels);
        }
Example #2
0
 private void MockTheSubscriber(AvailableChannel channel, PublishPackageRequestResponse publishPackageRequestResponse)
 {
     //var mockSubscriber = new Mock<ISubscriber>();
     //mockSubscriber.Setup(m => m.GetHeartbeat()).Returns(new GetHeartbeatResponse { Status = true, RootPath = @"destination root folder\Item One" });
     //mockSubscriber.Setup(m => m.TryOpenChannel(null)).Returns(new TryOpenChannelResponse{Status=true});
     //foreach(var changePushItem in publishPackageRequestResponse.ChangePushItems)
     //{
     //    mockSubscriber.Setup(
     //        m =>
     //        m.ApplyChangePushItem(new ApplyChangePushItemRequest
     //                                  {
     //                                      ChangePushItem = changePushItem,
     //                                      SourceRootName = publishPackageRequestResponse.SourceRootName
     //                                  })).Returns(
     //                                      new ApplyChangePushItemResponse
     //                                          {ChangePushItem = changePushItem, Success = true});
     //}
        channel.Subscriber = new MockRemoteSubscriber();
 }