Ejemplo n.º 1
0
        public void Should_be_possible_to_create_CollectInfoDTO_from_RequestColect()
        {
            var                     session        = this.GetSession();
            CollectRequest          collectRequest = new CollectRequestFactory().CreateCollectRequest(session).Item2;
            CollectRequestAssembler assembler      = new CollectRequestAssembler(dataProvider);
            CollectInfo             collectInfo    = assembler.CreateCollectInfoFromCollectRequest(collectRequest);

            Assert.IsNotNull(collectInfo);
            Assert.AreEqual(collectRequest.Oid.ToString(), collectInfo.CollectRequestId);
            Assert.AreEqual(collectRequest.Target.Address, collectInfo.Address);
            Assert.AreEqual(collectRequest.ReceivedOn, collectInfo.ReceivedOn);
        }
Ejemplo n.º 2
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.");
        }