Example #1
0
        public async Task TestGetDataMethod()
        {
            ISwapiService mockService = new MockSwapiService();

            PeopleViewModel vm = new PeopleViewModel();

            vm.SetService(mockService);

            await vm.GetData();

            Assert.IsTrue(vm.HasNextPage);
        }
Example #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);
        }
Example #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);
        }