Пример #1
0
 public void ToStringTest()
 {
     var line = "2012-12-05T17:00:00.0000000-08:00	186273	139562	106	0.057";
     var reader = new HopperCountReader(string.Empty);
     var actual = reader.ReadLine(line).ToString();
     actual.Should().Be(line);
 }
Пример #2
0
        public void ParseLine()
        {
            var expected = ExpectedFirstRecord();

            var line = "2012-12-05T17:00:00.0000000-08:00	186273	139562	106	0.057";
            var reader = new HopperCountReader(string.Empty);
            var actual = reader.ReadLine(line);
            actual.ShouldBeEquivalentTo(expected);
        }
Пример #3
0
        public void ParseFile()
        {
            var path = "..\\..\\..\\AdminData\\App_Data\\data.txt";
            File.Exists(path).Should().BeTrue("we need the test file to work");

            var reader = new HopperCountReader(path);
            var hopperCounts = reader.GetHopperCounts().ToArray();
            hopperCounts.Should().NotBeNull();
            hopperCounts.Should().NotBeEmpty();
            hopperCounts.First().ShouldBeEquivalentTo(ExpectedFirstRecord());
            hopperCounts.Count().Should().Be(File.ReadAllLines(path).Length - 1);
        }
Пример #4
0
 public HopperCountController(HopperCountReader reader)
 {
     this.reader = reader;
 }