コード例 #1
0
        public void GetVector_100PercentSuccess_WillMatchBoring()
        {
            // Arrange
            PingVectorFactory unitUnderTest = CreateFactory();
            IPingResponse     pingResponse  = new PingResponse(IPAddress.Loopback, TimeSpan.Zero, IPStatus.Success, IPAddress.Loopback);
            IPingStats        stats         = new PingStats(DateTime.Now, null)
            {
                Average25 = 0, Average25Count = 0, StatusHistory = Enumerable.Range(1, PingStatsUtil.MaxHistoryCount).Select(i => true).ToList()
            };

            // Act
            IVector actual = unitUnderTest.GetVector(
                pingResponse,
                stats);

            // Assert
            IVector expected = Boring;

            VectorComparer.AssertAreEqual(expected, actual, HundredthPi);
        }
コード例 #2
0
        public void GetVector_1Failure_CloseToInteresting()
        {
            // Arrange
            PingVectorFactory unitUnderTest = CreateFactory();
            IPingResponse     pingResponse  = new PingResponse(IPAddress.Loopback, TimeSpan.Zero, IPStatus.Success, IPAddress.Loopback);
            IPingStats        stats         = new PingStats(null, DateTime.Now)
            {
                Average25 = 0, Average25Count = 0, StatusHistory = Enumerable.Range(1, PingStatsUtil.MaxHistoryCount).Select(i => true).Append(false).ToList()
            };

            // Act
            IVector actual = unitUnderTest.GetVector(
                pingResponse,
                stats);

            // Assert
            IVector expected = Interesting;

            VectorComparer.AssertAreEqual(expected, actual, EighthPi);
        }