コード例 #1
0
        public int PeekCallduraion(CDR call)
        {
            int      durationInSec = call.GetDuration();
            TimeSpan startTime     = call.GetStartTime();
            int      Totalduration = 0;
            int      DayInSecond   = 60 * 60 * 24;

            if (durationInSec > DayInSecond)
            {
                Totalduration = Totalduration + checkExeedingLimit(24, startTime);
                Totalduration = Totalduration + checkExeedingLimit(durationInSec - 24, startTime);
            }
            return(checkExeedingLimit(durationInSec, startTime));
        }
コード例 #2
0
        public void OnSetCDR_withCDRDataAdd_ShouldSaveCDRDetails()
        {
            //Arrange
            CDR actual = _but.SetCDR("071-0000000", "071-1111111", new TimeSpan(12, 00, 00), 30);
            //Act
            CDR expected = new CDR("071-0000000", "071-1111111", new TimeSpan(12, 00, 00), 30);

            //Assert

            Assert.AreEqual(expected.GetSubscribeNumber(), actual.GetSubscribeNumber());
            Assert.AreEqual(expected.GetRecieveNumber(), actual.GetRecieveNumber());
            Assert.AreEqual(expected.GetStartTime(), actual.GetStartTime());
            Assert.AreEqual(expected.GetDuration(), actual.GetDuration());
        }