O'Reilly logo

Learning Dart by Ivo Balbaert, Dzenan Ridjanovic

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Testing the Travel Impressions model

After the model is designed, generated, and initialized with some data, the model should be tested to validate it further. In addition, writing tests applying the techniques we learned in Chapter 3, Structuring Code with Classes and Libraries, is the best way to start learning Dartling. Testing is done in the test/travel/impressions/travel_impressions_test.dart file. The main function creates a repository based on the JSON definition of the model and passes it to the testTravelData function:

testTravelData(TravelRepo travelRepo) {
  testTravelImpressions(travelRepo, TravelRepo.travelDomainCode,
      TravelRepo.travelImpressionsModelCode);
}

void main() {
var travelRepo = new TravelRepo(); testTravelData(travelRepo); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required