示例#1
0
        public void Should_not_be_possible_to_request_a_collect_to_a_target_with_a_requestID_null_or_empty()
        {
            var collectPackage = CollectRequestDtoFactory.CreateCollectPackageDTO(FAKE_IP);

            collectPackage.CollectRequests[0].RequestId = string.Empty;

            var requestIDs = CollectController.CollectRequest(collectPackage, FAKE_MODSIC_CLIENTID);
        }
示例#2
0
        public void Should_be_possible_to_request_a_collect_to_a_target()
        {
            var collectPackage = CollectRequestDtoFactory.CreateCollectPackageDTO(FAKE_IP);

            var requestIDs = CollectController.CollectRequest(collectPackage, FAKE_MODSIC_CLIENTID);

            Assert.IsNotNull(requestIDs, "The return of getCollectRequestion cannot be null.");
            Assert.IsNotNull(requestIDs[collectPackage.CollectRequests[0].RequestId], "the requestId cannot be null");
        }
示例#3
0
        public void Should_not_be_possible_to_request_a_collect_to_a_target_with_collectRequestItem_null()
        {
            var collectionRequest1 = CollectRequestDtoFactory.CreateCollectRequestDTO(FAKE_IP);

            collectionRequest1.RequestId = "129";
            var collectionRequest2 = CollectRequestDtoFactory.CreateCollectRequestDTO("192.168.14.10");

            collectionRequest2.RequestId = "57";

            var collectPackage = CollectRequestDtoFactory.CreateCollectPackageDTO();

            collectPackage.CollectRequests = new Request[] { collectionRequest1, null, collectionRequest2 };
            CollectController.CollectRequest(collectPackage, FAKE_MODSIC_CLIENTID);
        }
示例#4
0
        public void Should_be_possible_to_create_a_collectRequest_entity_from_collectRequest_DTO()
        {
            // Arrange
            //Session fakeSession = this.GetSession();
            //XpoDefault.DataLayer = XpoDefault.GetDataLayer(AutoCreateOption.DatabaseAndSchema);
            var fakeSession = GetSession();
            CollectRequestAssembler collectRequestAssembler = new CollectRequestAssembler(dataProvider);

            // Act
            var             collectPackageDTO = CollectRequestDtoFactory.CreateCollectPackageDTO("10.0.0.1");
            var             collectRequestDTO = collectPackageDTO.CollectRequests[0];
            var             collectRequest    = collectRequestAssembler.CreateCollectRequestFromDTO(collectRequestDTO, collectPackageDTO.Definitions.First().Text);
            TargetParameter targetParameter   = collectRequest.Target.GetTargetParameterByName("instance");

            //Assert
            Assert.AreEqual("10.0.0.1", collectRequest.Target.Address);
            Assert.IsNotNull(targetParameter, "There is no instance parameter in Request Modulo.Collect.");
        }
示例#5
0
        public void Should_not_be_possible_request_a_collect_to_a_target_with_a_duplicated_requestID()
        {
            var collectionRequest1 = CollectRequestDtoFactory.CreateCollectRequestDTO(FAKE_IP);

            collectionRequest1.RequestId = "10";

            var collectionRequest2 = CollectRequestDtoFactory.CreateCollectRequestDTO(FAKE_IP);

            collectionRequest2.RequestId = "10";

            var collectionRequest3 = CollectRequestDtoFactory.CreateCollectRequestDTO("192.168.1.18");

            collectionRequest3.RequestId = "48899";

            var collectPackage = CollectRequestDtoFactory.CreateCollectPackageDTO();

            collectPackage.CollectRequests =
                new Request[] { collectionRequest1, collectionRequest2, collectionRequest3 };

            var requestIDs = CollectController.CollectRequest(collectPackage, FAKE_MODSIC_CLIENTID);
        }