File size: 594 Bytes
02ec2cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// load sample.html and run findTopSteamSellers, expect list of top steam sellers
import 'dart:io';
import 'package:test/test.dart';
import "package:dart_off_server/core.dart" as core;
import "package:path/path.dart" as p;

void main() {
  test('calculate', () {
      var rawHTMLPath = p.join(p.current, 'test', 'sample.html');
      // load rawHTML from rawHTMLPath
      File file = File(rawHTMLPath);
      var rawHTML = file.readAsStringSync();
      var steamSellers = core.parseSteamTopSellers(rawHTML);
      // greater than 5
      expect(steamSellers.length, greaterThan(5));
  });
}