public void HAGetConfigResultsOutOfLimitTest()
        {
            // Test getting aggregator configuration with 2 successful sub-service responses
            // Some values are out of bounds

            IKsiService haService = GetHAService(
                new List <PduPayload>()
            {
                GetAggregatorConfigResponsePayload(1, 2, 99, 4, new List <string>()
                {
                    "uri-1"
                })
            },
                new List <PduPayload>()
            {
                GetAggregatorConfigResponsePayload(21, null, 20001, 16001, null)
            });

            AggregatorConfig config = haService.GetAggregatorConfig();

            Assert.AreEqual(1, config.MaxLevel, "Unexpected max level value");
            Assert.AreEqual(2, config.AggregationAlgorithm, "Unexpected algorithm value");
            Assert.IsNull(config.AggregationPeriod, "Unexpected aggregation period value");
            Assert.AreEqual(4, config.MaxRequests, "Unexpected max requests value");
            Assert.AreEqual(1, config.ParentsUris.Count, "Unexpected parent uri count");
            Assert.AreEqual("uri-1", config.ParentsUris[0], "Unexpected parent uri value at position 0");
        }
        public void HAGetConfigTwoResultsTest4()
        {
            // Test getting aggregator configuration with 2 successful sub-service responses

            IKsiService haService = GetHAService(
                new List <PduPayload>()
            {
                GetAggregatorConfigResponsePayload(1, 2, 100, 4, new List <string>()
                {
                    "uri-1"
                }),
            },
                new List <PduPayload>()
            {
                GetAggregatorConfigResponsePayload(null, null, null, null, null)
            });

            AggregatorConfig config = haService.GetAggregatorConfig();

            Assert.AreEqual(1, config.MaxLevel, "Unexpected max level value");
            Assert.AreEqual(2, config.AggregationAlgorithm, "Unexpected algorithm value");
            Assert.AreEqual(100, config.AggregationPeriod, "Unexpected aggregation period value");
            Assert.AreEqual(4, config.MaxRequests, "Unexpected max requests value");
            Assert.AreEqual(1, config.ParentsUris.Count, "Unexpected parent uri count");
            Assert.AreEqual("uri-1", config.ParentsUris[0], "Unexpected parent uri value at position 0");
        }
        public void HAGetConfigSingleResultAllNullsTest()
        {
            // Test getting aggregator configuration with 1 successful sub-service response
            // All the values are empty

            IKsiService haService = GetHAService(
                new List <PduPayload>()
            {
                GetAggregatorConfigResponsePayload(null, null, null, null, null),
            });

            AggregatorConfig config = haService.GetAggregatorConfig();

            Assert.IsNull(config.MaxLevel, "Unexpected max level value");
            Assert.IsNull(config.AggregationAlgorithm, "Unexpected algorithm value");
            Assert.IsNull(config.AggregationPeriod, "Unexpected aggregation period value");
            Assert.IsNull(config.MaxRequests, "Unexpected max requests value");
            Assert.AreEqual(0, config.ParentsUris.Count, "Unexpected parent uri list");
        }
Пример #4
0
 /// <summary>
 /// Get additional aggregator configuration data
 /// </summary>
 /// <returns>Aggregator configuration data</returns>
 public AggregatorConfig GetAggregatorConfig()
 {
     return(_ksiService.GetAggregatorConfig());
 }