Ejemplo n.º 1
0
        public async Task TestGetDataMethod()
        {
            ISwapiService mockService = new MockSwapiService();

            PeopleViewModel vm = new PeopleViewModel();

            vm.SetService(mockService);

            await vm.GetData();

            Assert.IsTrue(vm.HasNextPage);
        }
Ejemplo n.º 2
0
        public async Task TestNextPageMethod()
        {
            ISwapiService mockService = new MockSwapiService();

            PeopleViewModel vm = new PeopleViewModel();

            vm.SetService(mockService);

            await vm.GetData();

            Assert.AreEqual("https://swapi.co/api/people/?format=json&page=2", vm.nextPage);
        }
Ejemplo n.º 3
0
        public async Task TestGetDataCountMethod()
        {
            ISwapiService mockService = new MockSwapiService();

            PeopleViewModel vm = new PeopleViewModel();

            vm.SetService(mockService);

            await vm.GetData();

            Assert.AreEqual(20, vm.People.Count);
        }