Ejemplo n.º 1
0
        public void HAGetConfigResultsOutOfLimitTest()
        {
            // Test getting extender configuration with 2 successful sub-service responses
            // Some values are out of bounds

            IKsiService haService = GetHAService(
                new List <PduPayload>()
            {
                GetExtenderConfigResponsePayload(4, new List <string>()
                {
                    "uri-1"
                }, 1136073601, 1136073600)
            },
                new List <PduPayload>()
            {
                GetExtenderConfigResponsePayload(16001, null, 1136073599, 1136073598)
            });

            ExtenderConfig config = haService.GetExtenderConfig();

            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");
            Assert.AreEqual(1136073601, config.CalendarFirstTime, "Unexpected calendar first time value");
            Assert.IsNull(config.CalendarLastTime, "Unexpected calendar last time value");
        }
Ejemplo n.º 2
0
        public void HAGetConfigTwoResultsTest3()
        {
            // Test getting extender configuration with 2 successful sub-service responses

            IKsiService haService = GetHAService(
                new List <PduPayload>()
            {
                GetExtenderConfigResponsePayload(null, null, null, null),
            },
                new List <PduPayload>()
            {
                GetExtenderConfigResponsePayload(4, new List <string>()
                {
                    "uri-2"
                }, 1136073600, 2136073600)
            });

            ExtenderConfig config = haService.GetExtenderConfig();

            Assert.AreEqual(4, config.MaxRequests, "Unexpected max requests value");
            Assert.AreEqual(1, config.ParentsUris.Count, "Unexpected parent uri count");
            Assert.AreEqual("uri-2", config.ParentsUris[0], "Unexpected parent uri value at position 0");
            Assert.AreEqual(1136073600, config.CalendarFirstTime, "Unexpected calendar first time value");
            Assert.AreEqual(2136073600, config.CalendarLastTime, "Unexpected calendar last time value");
        }
Ejemplo n.º 3
0
        public void HAExtenderConfigRequestWithSingleServiceTest()
        {
            // Test getting extender configuration with single sub-service
            IKsiService haService = GetHAService(
                new List <PduPayload>()
            {
                GetExtenderConfigResponsePayload(4, new List <string>()
                {
                    "uri-1"
                }, 1136073600, 2136073600)
            });

            haService.GetExtenderConfig();

            ExtenderConfig config = haService.GetExtenderConfig();

            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");
            Assert.AreEqual(1136073600, config.CalendarFirstTime, "Unexpected calendar first time value");
            Assert.AreEqual(2136073600, config.CalendarLastTime, "Unexpected calendar last time value");
        }
Ejemplo n.º 4
0
        public void HAGetConfigSingleResultAllNullsTest()
        {
            // Test getting extender configuration with 1 successful sub-service response
            // All the values are empty

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

            ExtenderConfig config = haService.GetExtenderConfig();

            Assert.IsNull(config.MaxRequests, "Unexpected max requests value");
            Assert.AreEqual(0, config.ParentsUris.Count, "Unexpected parent uri list");
            Assert.IsNull(config.CalendarFirstTime, "Unexpected calendar first time value");
            Assert.IsNull(config.CalendarLastTime, "Unexpected calendar last time value");
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Get additional extender configuration data
 /// </summary>
 /// <returns>Extender configuration data</returns>
 public ExtenderConfig GetExtenderConfig()
 {
     return(_ksiService.GetExtenderConfig());
 }