Example #1
0
        public void GivenAListOfPropRefs_WhenItIsExecuted_ThenItReturnsAListOfSpecifiedPropertyObjects(string propertyReference, string propertyReference2)
        {
            //arrange
            var property1 = _uhPropertyHelper.GenerateUhProperty();

            property1.PropRef = propertyReference;
            var property2 = _uhPropertyHelper.GenerateUhProperty();

            property2.PropRef = propertyReference2;

            _uhContext.UhPropertys.Add(property1);
            _uhContext.UhPropertys.Add(property2);
            _uhContext.SaveChanges();

            var propertyReferences = new List <string> {
                propertyReference, propertyReference2
            };
            //act
            List <Property> propertiesList = _classUnderTest.GetMultiplePropertiesByPropertyListOfReferences(propertyReferences);

            //assert
            propertiesList.Should().NotBeNull();
            propertiesList.Should().BeOfType <List <Property> >();

            Assert.AreEqual(propertyReferences[0], propertiesList[0].PropRef);
            Assert.AreEqual(propertyReferences[1], propertiesList[1].PropRef);
        }
Example #2
0
        public GetMultiplePropertiesUseCaseResponse Execute(GetMultiplePropertiesUseCaseRequest request)
        {
            IList <string> propertyReferences = request.PropertyReferences;

            List <Property> properties = _getMultiplePropertiesGateway.GetMultiplePropertiesByPropertyListOfReferences(propertyReferences);

            return(new GetMultiplePropertiesUseCaseResponse(properties));
        }