Ejemplo n.º 1
0
        public void GetMeasurements_WhenGivenRealDataDirectory_ReturnsExpectedMeasurements()
        {
            // Arrange
            var sut    = new FilesystemEventDataFetcher();
            var events = sut.FetchEvents(@"..\..\TestData\archive")
                         .ToList();
            var odd = events.Single(e => e.Opponent == "Odd");

            // Act
            var res = sut.GetMeasurements(odd)
                      .ToList();

            // Assert
            res.Count.Should().Be(3, "there are three measurements in this directory");
            res.All(m => m.EventId == 438523).Should().BeTrue("all measurements should return the same event id");
            res.All(m => m.MeasurementTime.Year == 2015 && m.MeasurementTime.Month == 6 && m.MeasurementTime.Day == 30)
            .Should()
            .BeTrue("all measurements should have the same date");
            res.Count(m => m.MeasurementTime.Hour == 12 && m.MeasurementTime.Minute == 12)
            .Should()
            .Be(1, "only one of the measurements should match");
            res.Count(m => m.MeasurementTime.Hour == 12 && m.MeasurementTime.Minute == 42)
            .Should()
            .Be(1, "only one of the measurements should match");
            res.Count(m => m.MeasurementTime.Hour == 13 && m.MeasurementTime.Minute == 12)
            .Should()
            .Be(1, "only one of the measurements should match");
        }
Ejemplo n.º 2
0
        public void GetMeasurements_WhenGivenRealDataDirectory_ReturnsExpectedMeasurements()
        {
            // Arrange
            var sut    = new FilesystemEventDataFetcher();
            var events = sut.FetchEvents(@"..\..\TestData\storage\2015")
                         .ToList();
            var vikingur = events.Single(e => e.Opponent == "Vikingur");

            // Act
            var res = sut.GetMeasurements(vikingur)
                      .ToList();

            // Assert
            res.Count.Should().Be(3, "there are 3 measurements in this directory");
            res.All(m => m.EventId == 467263).Should().BeTrue("all measurements should return the same event id");
        }