Пример #1
0
        internal ClusterInfo GetCluster()
        {
            var destinationManager = new DestinationManager();

            destinationManager.GetOrCreateItem("dest-A", d => { });
            destinationManager.GetOrCreateItem(AffinitizedDestinationName, d => { });
            destinationManager.GetOrCreateItem("dest-C", d => { });

            var cluster = new ClusterInfo("cluster-1", destinationManager);

            cluster.Config = ClusterConfig;
            cluster.UpdateDynamicState();
            return(cluster);
        }
        public void GetOrCreateItem_NonExistentItem_CreatesNewItem()
        {
            var manager = new DestinationManager();

            var item = manager.GetOrCreateItem("abc", item => { });

            Assert.NotNull(item);
            Assert.Equal("abc", item.DestinationId);
        }
        internal ClusterInfo GetCluster()
        {
            var destinationManager = new DestinationManager();

            destinationManager.GetOrCreateItem("dest-A", d => { });

            var cluster = new ClusterInfo("cluster-1", destinationManager);

            cluster.Config = new ClusterConfig(new Cluster
            {
                SessionAffinity = new SessionAffinityOptions
                {
                    Enabled       = true,
                    Mode          = "Mode-B",
                    FailurePolicy = "Policy-1",
                }
            },
                                               new HttpMessageInvoker(new Mock <HttpMessageHandler>().Object));

            cluster.UpdateDynamicState();
            return(cluster);
        }