public void GetAllCameraKeyValuePairShouldReturnCorrectNumber()
        {
            var list = new List <Camera>
            {
                new Camera
                {
                    Id    = 1,
                    Model = "IphoneX",
                },
                new Camera
                {
                    Id    = 2,
                    Model = "Iphone6",
                },
                new Camera
                {
                    Id    = 3,
                    Model = "Xiomi Mi A3",
                },
            };

            var repository = new Mock <IDeletableEntityRepository <Camera> >();

            repository.Setup(r => r.AllAsNoTracking()).Returns(() => list.AsQueryable());
            var service = new CameraService(repository.Object);

            var cameras = service.GetAllCamerasAsKeyValuePair();

            Assert.Equal(3, cameras.Count());
            repository.Verify(x => x.AllAsNoTracking(), Times.Once);
        }
        public void GetAllCameraKeyValuePairShouldReturnZeroWhenEmpty()
        {
            var list = new List <Camera>();

            var repository = new Mock <IDeletableEntityRepository <Camera> >();

            repository.Setup(r => r.AllAsNoTracking()).Returns(() => list.AsQueryable());
            var service = new CameraService(repository.Object);

            var cameras = service.GetAllCamerasAsKeyValuePair();

            Assert.Empty(cameras);
            repository.Verify(x => x.AllAsNoTracking(), Times.Once);
        }