예제 #1
0
        public void GetDevicesOfType(string classificationName)
        {
            var deviceManager = new DeviceManager();
            var classification = new DeviceClass()
            {
                Name = classificationName
            };

            deviceManager.Devices = new List<IDevice>() {
                new Device()
                {
                    Classification = classification
                }
            };
            
            var devicesByClassification = deviceManager.GetDevicesOfType(classification);

            Assert.Equal(1, devicesByClassification.Count());
            Assert.Equal(classificationName, devicesByClassification.FirstOrDefault().Classification.Name);

            var devicesByClassificationName = deviceManager.GetDevicesOfType(classification);

            Assert.Equal(1, devicesByClassificationName.Count());
            Assert.Equal(classificationName, devicesByClassificationName.FirstOrDefault().Classification.Name);
        }
예제 #2
0
 public List<IDevice> GetDevicesOfType(DeviceClass deviceClass)
 {
     var type = Devices?.Where(d => d.Classification != null && d.Classification.Equals(deviceClass));
     return Devices?.Where(d => d.Classification != null && d.Classification.Equals(deviceClass)).ToList();
 }
예제 #3
0
        public List <IDevice> GetDevicesOfType(DeviceClass deviceClass)
        {
            var type = Devices?.Where(d => d.Classification != null && d.Classification.Equals(deviceClass));

            return(Devices?.Where(d => d.Classification != null && d.Classification.Equals(deviceClass)).ToList());
        }