public async Task TestGetDataMethod() { ISwapiService mockService = new MockSwapiService(); PeopleViewModel vm = new PeopleViewModel(); vm.SetService(mockService); await vm.GetData(); Assert.IsTrue(vm.HasNextPage); }
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); }
public async Task TestGetDataCountMethod() { ISwapiService mockService = new MockSwapiService(); PeopleViewModel vm = new PeopleViewModel(); vm.SetService(mockService); await vm.GetData(); Assert.AreEqual(20, vm.People.Count); }