public async void TestCreateNetworkStatusTimelineWithEmptyInput( IEnumerable <string> networkControllerResultValues, IEnumerable <DateTime> networkControllerResultDates, IEnumerable <string> networkControllerResultOperations) { var resultCollection = this.GetStoreTestResultCollection(networkControllerResultValues, networkControllerResultDates, networkControllerResultOperations); var ex = await Assert.ThrowsAsync <ArgumentException>(async() => await NetworkStatusTimeline.Create(resultCollection, new TimeSpan(0, 0, 0, 0, 5))); Assert.Equal("Network Controller Test Results is empty.", ex.Message); }
public async void TestCreateNetworkStatusTimelineWithMismatchedNetworkStatuses( IEnumerable <string> networkControllerResultValues, IEnumerable <DateTime> networkControllerResultDates, IEnumerable <string> networkControllerResultOperations) { var resultCollection = this.GetStoreTestResultCollection(networkControllerResultValues, networkControllerResultDates, networkControllerResultOperations); NetworkStatusTimeline timeline = await NetworkStatusTimeline.Create(resultCollection, new TimeSpan(0, 0, 0, 0, 5)); var ex = Assert.Throws <InvalidOperationException>(() => timeline.GetNetworkControllerStatusAndWithinToleranceAt(new DateTime(2020, 1, 1, 9, 10, 16, 10))); Assert.Equal("Test result SettingRule and following RuleSet do not match NetwokControllerStatuses", ex.Message); }
public async void TestCreateNetworkStatusTimelineWithIdenticalConsecutiveOperations( IEnumerable <string> networkControllerResultValues, IEnumerable <DateTime> networkControllerResultDates, IEnumerable <string> networkControllerResultOperations) { var resultCollection = this.GetStoreTestResultCollection(networkControllerResultValues, networkControllerResultDates, networkControllerResultOperations); NetworkStatusTimeline timeline = await NetworkStatusTimeline.Create(resultCollection, new TimeSpan(0, 0, 0, 0, 5)); var ex = Assert.Throws <InvalidOperationException>(() => timeline.GetNetworkControllerStatusAndWithinToleranceAt(new DateTime(2020, 1, 1, 9, 10, 16, 10))); Assert.Equal("Test result SettingRule found with no RuleSet found after.", ex.Message); }
public async void TestCreateNetworkStatusTimeline( IEnumerable <string> networkControllerResultValues, IEnumerable <DateTime> networkControllerResultDates, IEnumerable <string> networkControllerResultOperations) { var resultCollection = this.GetStoreTestResultCollection(networkControllerResultValues, networkControllerResultDates, networkControllerResultOperations); NetworkStatusTimeline timeline = await NetworkStatusTimeline.Create(resultCollection, new TimeSpan(0, 0, 0, 0, 5)); (NetworkControllerStatus status, bool inTolerance) = timeline.GetNetworkControllerStatusAndWithinToleranceAt(new DateTime(2020, 1, 1, 9, 10, 11, 10)); Assert.Equal(NetworkControllerStatus.Disabled, status); Assert.False(inTolerance); (status, inTolerance) = timeline.GetNetworkControllerStatusAndWithinToleranceAt(new DateTime(2020, 1, 1, 9, 10, 16, 10)); Assert.Equal(NetworkControllerStatus.Enabled, status); Assert.False(inTolerance); (status, inTolerance) = timeline.GetNetworkControllerStatusAndWithinToleranceAt(new DateTime(2020, 1, 1, 9, 10, 20, 15)); Assert.Equal(NetworkControllerStatus.Disabled, status); Assert.True(inTolerance); (status, inTolerance) = timeline.GetNetworkControllerStatusAndWithinToleranceAt(new DateTime(2020, 1, 1, 9, 10, 25, 11)); Assert.Equal(NetworkControllerStatus.Enabled, status); Assert.True(inTolerance); (status, inTolerance) = timeline.GetNetworkControllerStatusAndWithinToleranceAt(new DateTime(2020, 1, 1, 9, 10, 25, 12)); Assert.Equal(NetworkControllerStatus.Enabled, status); Assert.True(inTolerance); }