MultilingualPlugin icon indicating copy to clipboard operation
MultilingualPlugin copied to clipboard

Use plugin in unit tests

Open juniorjrjl opened this issue 6 years ago • 1 comments

Ho, whe I try test My viewmodel I get the follow exception:

System.NotImplementedException HResult=0x80004001 Message=This functionality is not implemented in the portable version of this assembly. You should reference the NuGet package from your main application project in order to reference the platform-specific implementation. Source=Plugin.Multilingual StackTrace: at Plugin.Multilingual.CrossMultilingual.get_Current() at TrackerMobile.Forms.ViewModels.EnvioComandoVeiculoViewModel..ctor(AbstractEnvioComandoService envioComandoService, IDBUtils dBUtils, AbstractParametroDAO parametroDAO, IPageDialogService pageDialogService, INavigationService navigationService) in A:\projetos_estudo\C#\mobile\TrackerMobile\TrackerMobile.Forms\TrackerMobile.Forms\ViewModels\EnvioComandoVeiculoViewModel.cs:line 124 at TrackerMobile.TesteUnitario.ViewModel.EnvioComandoVeiculoViewModelTest.QuandoIniciarViewModel_NaoDispararException() in A:\projetos_estudo\C#\mobile\TrackerMobile\TrackerMobile.TesteUnitario\ViewModel\EnvioComandoVeiculoViewModeltest.cs:line 74 How can I configure my test tu work ? Follow my viewmodel:

public EnvioComandoVeiculoViewModel(AbstractEnvioComandoService envioComandoService, IDBUtils dBUtils, AbstractParametroDAO parametroDAO, IPageDialogService pageDialogService, INavigationService navigationService) { _envioComandoService = envioComandoService; _dBUtils = dBUtils; _parametroDAO = parametroDAO; _pageDialogService = pageDialogService; _navigationService = navigationService; _parametroDAO.DbPath = _dBUtils.ObterCaminhoBanco(); _envioComandoService.IpServidor = _parametroDAO.BuscarIp(); _envioComandoService.AccessToken = SessaoUsuario.UsuarioLogado.AccessToken; _envioComandoService.IdiomaAplicacao = CrossMultilingual.Current.CurrentCultureInfo.ToString(); }

thank you :)

juniorjrjl avatar Nov 12 '18 20:11 juniorjrjl

Same sh** here :D

That's an old issue , but i have to try ahah.

If you found a solution and remember it @juniorjrjl , i'm listening :)

jm-parent avatar May 20 '20 08:05 jm-parent