コード例 #1
0
        public void AddInPlace()
        {
            DecayingDouble d = new DecayingDouble(4, FirstDayOfCentury);

            d.AddInPlace(OneDay, 3, TwoDaysLater);
            Assert.InRange(d.ValueAtTimeOfLastUpdate, 3.99999, 4.000001);
            double shouldBeVeryCloseTo1 = d.GetValue(OneDay, FourDaysLater);

            Assert.InRange(shouldBeVeryCloseTo1, .99999, 1.000001);
        }
コード例 #2
0
ファイル: SimIpHistory.cs プロジェクト: szm88891/StopGuessing
 public double[] GetAllScores(TimeSpan halfLife, DateTime whenUtc)
 {
     return(new double[]
     {
         SuccessfulLogins.GetValue(halfLife, whenUtc),
         AccountFailuresInfrequentPassword.GetValue(halfLife, whenUtc),
         AccountFailuresFrequentPassword.GetValue(halfLife, whenUtc),
         RepeatAccountFailuresInfrequentPassword.GetValue(halfLife, whenUtc),
         RepeatAccountFailuresFrequentPassword.GetValue(halfLife, whenUtc),
         PasswordFailuresNoTypoInfrequentPassword.GetValue(halfLife, whenUtc),
         PasswordFailuresNoTypoFrequentPassword.GetValue(halfLife, whenUtc),
         PasswordFailuresTypoInfrequentPassword.GetValue(halfLife, whenUtc),
         PasswordFailuresTypoFrequentPassword.GetValue(halfLife, whenUtc),
         RepeatPasswordFailuresNoTypoInfrequentPassword.GetValue(halfLife, whenUtc),
         RepeatPasswordFailuresNoTypoFrequentPassword.GetValue(halfLife, whenUtc),
         RepeatPasswordFailuresTypoInfrequentPassword.GetValue(halfLife, whenUtc),
         RepeatPasswordFailuresTypoFrequentPassword.GetValue(halfLife, whenUtc)
     });
 }