Ejemplo n.º 1
0
        public void DictionaryShouldReturnOnlyThoseDaysWhichRepeatsForEachProduct()
        {
            var givenData = new[]
            {
                new[] { 3, 5, 7, 1 },
                new[] { 8, 9, 7, 6 },
                new[] { 1, 3, 7, 9 }
            };

            var expectedResult = new[] { 7 };

            var result = new DeliveryDateDictionary(givenData).DaysToDelivery;

            Assert.AreEqual(expectedResult, result);
        }
Ejemplo n.º 2
0
        public void DictionaryShouldReturnEmptyListWhenThereIsNoDayWhichOccuresForEachProduct()
        {
            var givenData = new[]
            {
                new[] { 3, 5, 7, 1 },
                new[] { 8, 9, 5, 6 },
                new[] { 1, 3, 7, 9 }
            };

            var expectedResult = new List <int>();

            var result = new DeliveryDateDictionary(givenData).DaysToDelivery;

            Assert.AreEqual(expectedResult, result);
        }
Ejemplo n.º 3
0
        private bool CommonDeliveryDayExist(IEnumerable <ProductDTO> productList)
        {
            var result = new DeliveryDateDictionary(productList.Select(p => p.DeliveryDays.Select(d => (int)d))).DaysToDelivery.Any();

            return(result);
        }