예제 #1
0
        public NewCharacterPage()
        {
            InitializeComponent();

            BindingContext        = _viewModel = DependencyService.Resolve <NewCharacterViewModel>();
            _viewModel.Navigation = Navigation;
        }
        public void LoadCommand_populates_Actors()
        {
            var characterRepository = new Mock <ICharacterRepository>();

            var actors = new[] { new ActorDTO {
                                     Id = 42, Name = "actor"
                                 } };
            var actorRepository = new Mock <IActorRepository>();

            actorRepository.Setup(s => s.ReadAsync()).ReturnsAsync(actors);

            var viewModel = new NewCharacterViewModel(characterRepository.Object, actorRepository.Object);

            viewModel.LoadCommand.Execute(null);

            Assert.Equal(actors, viewModel.Actors);
        }
예제 #3
0
 public NewCharacterPage()
 {
     InitializeComponent();
     BindingContext = _viewModel = new NewCharacterViewModel();
     LoadInfo();
 }