public void SetUp()
 {
     _IWindow = Substitute.For<IWindow>();
     _IWebServicesSettings = Substitute.For<IDiscogsAuthentificationProvider>();
     _Infra = Substitute.For<IInfraDependencies>();
     _Target = new ImportKeyViewModel(_IWebServicesSettings, _Infra) { Window = _IWindow };
 }
        public void TestCommand()
        {
            _IWebServicesSettings = Substitute.For<IDiscogsAuthentificationProvider>();
            _Infra = Substitute.For<IInfraDependencies>();
            FileSystem fs = new FileSystem();
            _Infra.File.Returns(fs);

            _Target = new ExportKeyViewModel(_IWebServicesSettings, _Infra);
    
            ICommand com = _Target.Commit;
            com.MonitorEvents();

            com.Should().NotBeNull();
            com.CanExecute(null).Should().BeTrue();

            com.ShouldNotRaise("CanExecuteChanged");

            _Target.Directory = "24";

            com.CanExecute(null).Should().BeFalse();
            com.ShouldRaise("CanExecuteChanged");
   
            _Target.Directory = @"C:\";

            com.CanExecute(null).Should().BeTrue();
            com.ShouldRaise("CanExecuteChanged");
        }
 public ExportKeyViewModel(IDiscogsAuthentificationProvider iIWebServicesSettings, IInfraDependencies idp) :
     base(iIWebServicesSettings, idp)
 {
     _FileTools = idp.File;
     this.Directory = _FileTools.DocumentFolder;
     Commit = this.Register(RelayCommand.InstanciateAsync(() => DoCommit(), () => _FileTools.DirectoryExists(Directory)));
 }
 protected ExchangeKeyViewModelBase(IDiscogsAuthentificationProvider iIWebServicesSettings, IInfraDependencies idep)
 {
     //_IWebServicesSettings = iIWebServicesSettings;
     _IWebServicesSettingsWrapper = iIWebServicesSettings;
     _Infra = idep;
     _Password = string.Empty; 
 }
        public DiscogsOAuthViewModel(IDiscogsAuthentificationProvider iWebServicesSettings)
        {
            _CanFinalizePin = false;
            _IWebServicesSettings = iWebServicesSettings;
            _Url = _IWebServicesSettings.ComputeLinkForDiscogsOAuthAuthorization();

            FinalizePin = RelayCommand.Instanciate(Activate, ()=>CanFinalizePin);
        }
        public ImportKeyViewModel(IDiscogsAuthentificationProvider iIWebServicesSettings, IInfraDependencies idp) :
            base(iIWebServicesSettings, idp)
        {
            Directory = idp.File.DocumentFolder;
            _FileTools =  _Infra.File;

            Commit = this.Register(RelayCommand.Instanciate(() => DoCommit(), () => _FileTools.FileExists(FilePath)));
    
            FileExtension = _FileTools.GetFileFilter(_FileTools.KeysFileExtesion,"key files"); 
        }
        //private ViewModelBase Father;

        internal WebsiteMusicSettings(IWebUserSettings iIMusicSettings, IInfraDependencies ims, ViewModelBase iFather)
        {
            _IWebServicesSettingsWrapper = iIMusicSettings.GetDiscogsAutentificator();
            Father = iFather;
            _IInfraDependencies = ims;
            _IWebServicesSettings = iIMusicSettings;
            _DiscogsTimeOut = _IWebServicesSettings.DiscogsTimeOut;
            _FDBS = _IWebServicesSettings.FreedbServer;
            _AA = _IWebServicesSettings.AmazonActivated;
            _DA = _IWebServicesSettings.DiscogsActivated;
            _IsDiscogImageActivated = _IWebServicesSettingsWrapper.IsDiscogImageActivated;
            FreedbServers = _IWebServicesSettings.FreedbServers;

            ActivateDiscogs = this.Register(RelayCommand.Instanciate(DoActivateDiscogs, () => !IsDiscogImageActivated));
            ExportDiscogs = this.Register(RelayCommand.Instanciate(DoExportDiscogs, () => IsDiscogImageActivated));
            ImportDiscogs = RelayCommand.Instanciate(DoImportDiscogs);
        }