示例#1
0
        private IEXIFViewModel SetupISORatingTest(decimal iso, bool setupCamera = true)
        {
            IEXIFModel exif = ueb.GetEmptyEXIFModel();

            AssertNotNull("GetEmptyEXIFModel", exif);

            exif.Make         = "Canon";
            exif.ISOValue     = iso;
            exif.FNumber      = 8;
            exif.ExposureTime = 0.008m;

            IEXIFViewModel vmdl = ueb.GetEXIFViewModel(exif);

            AssertNotNull("GetEXIFViewModel", vmdl);

            if (setupCamera)
            {
                ICameraModel camera = ueb.GetCameraModel("Canon", "EOS 80D");
                AssertNotNull("GetCameraModel", camera);
                camera.ISOLimitGood       = 400;
                camera.ISOLimitAcceptable = 800;
                vmdl.Camera = ueb.GetCameraViewModel(camera);
            }
            return(vmdl);
        }
示例#2
0
 public PictureViewModel(IPictureModel pm)
 {
     _PictureModel = (PictureModel)pm;
     _PictureModel.PropertyChanged += new PropertyChangedEventHandler(SubPropertyChanged);
     if (_PictureModel.IPTC != null)
     {
         _IPTCViewModel = new IPTCViewModel(_PictureModel.IPTC);
         ((IPTCViewModel)_IPTCViewModel).PropertyChanged += new PropertyChangedEventHandler(SubPropertyChanged);
     }
     if (_PictureModel.EXIF != null)
     {
         _EXIFViewModel = new EXIFViewModel(_PictureModel.EXIF, this);
         ((EXIFViewModel)_EXIFViewModel).PropertyChanged += new PropertyChangedEventHandler(SubPropertyChanged);
     }
     if (_PictureModel.Photographer != null)
     {
         _PhotographerViewModel = new PhotographerViewModel(_PictureModel.Photographer);
         ((PhotographerViewModel)_PhotographerViewModel).PropertyChanged += new PropertyChangedEventHandler(SubPropertyChanged);
     }
     if (_PictureModel.Camera != null)
     {
         _CameraViewModel = new CameraViewModel(_PictureModel.Camera);
         ((CameraViewModel)_CameraViewModel).PropertyChanged += new PropertyChangedEventHandler(SubPropertyChanged);
     }
 }
示例#3
0
 public EXIFModel(IEXIFViewModel viewModel)
 {
     Make            = viewModel.Make;
     FNumber         = viewModel.FNumber;
     ExposureTime    = viewModel.ExposureTime;
     ISOValue        = viewModel.ISOValue;
     Flash           = viewModel.Flash;
     ExposureProgram = ConvertExposureProgram(viewModel.ExposureProgram);
 }
示例#4
0
 public EXIFModel(IEXIFViewModel eXIF)
 {
     this.Make            = eXIF.Make;
     this.ExposureProgram = ConvertExposureProgram(eXIF.ExposureProgram);
     this.ExposureTime    = eXIF.ExposureTime;
     this.FNumber         = eXIF.FNumber;
     this.ISOValue        = eXIF.ISOValue;
     this.Flash           = eXIF.Flash;
 }
示例#5
0
        public void EXIFViewModel_should_return_ExposureProgramResource()
        {
            IEXIFModel mdl = ueb.GetEmptyEXIFModel();

            AssertNotNull("GetEmptyEXIFModel", mdl);

            mdl.ExposureProgram = ExposurePrograms.Manual;

            IEXIFViewModel vmdl = ueb.GetEXIFViewModel(mdl);

            AssertNotNull("GetEXIFViewModel", vmdl);

            AssertNotEmptyOrNull(vmdl.ExposureProgramResource);
        }
示例#6
0
        public void EXIFViewModel_should_reflect_Model()
        {
            IEXIFModel mdl = ueb.GetEmptyEXIFModel();

            AssertNotNull("GetEmptyEXIFModel", mdl);

            mdl.Make         = "Canon";
            mdl.ISOValue     = 200;
            mdl.FNumber      = 8;
            mdl.ExposureTime = 0.008m;

            IEXIFViewModel vmdl = ueb.GetEXIFViewModel(mdl);

            AssertNotNull("GetEXIFViewModel", vmdl);
            AssertEquals("Canon", vmdl.Make);
            AssertEquals(200, vmdl.ISOValue);
            AssertEquals(8, vmdl.FNumber);
            AssertEquals(0.008m, vmdl.ExposureTime);
        }
示例#7
0
        public void ExifViewModel_should_reflect_ISORating_without_camera()
        {
            IEXIFViewModel vmdl = SetupISORatingTest(0, false);

            AssertEquals(ISORatings.NotDefined, vmdl.ISORating);
        }
示例#8
0
        public void ExifViewModel_should_reflect_ISORating_1600()
        {
            IEXIFViewModel vmdl = SetupISORatingTest(1600);

            AssertEquals(ISORatings.Noisey, vmdl.ISORating);
        }
示例#9
0
        public void ExifViewModel_should_reflect_ISORating_800()
        {
            IEXIFViewModel vmdl = SetupISORatingTest(800);

            AssertEquals(ISORatings.Acceptable, vmdl.ISORating);
        }
示例#10
0
        public void Hello_Empty_EXIFViewModel()
        {
            IEXIFViewModel obj = ueb.GetEmptyEXIFViewModel();

            AssertNotNull("GetEmptyEXIFViewModel", obj);
        }