示例#1
0
        public void PartsFilterByDesignations_ShouldReturnAllRecordsIfDesignationIsNullO()
        {
            var expectedParts = partsExamples;

            var motorService = new MotorService(new DataAccessByMemoryCache());
            var expected     = motorService.PartsFilterByDesignations(partsExamples, null);

            Assert.Equal(expectedParts.OrderBy(m => m.PartNumber), expected.OrderBy(m => m.PartNumber));
        }
示例#2
0
        public void PartsFilterByDesignations_ShouldReturnCorrectResult()
        {
            var designations = new List <string>()
            {
                "NUT"
            };
            var expectedParts = new List <Part>()
            {
                partsExamples[2], partsExamples[3]
            };

            var motorService = new MotorService(new DataAccessByMemoryCache());
            var result       = motorService.PartsFilterByDesignations(partsExamples, designations);

            Assert.Equal(expectedParts.OrderBy(m => m.PartNumber), result.OrderBy(m => m.PartNumber));
        }