예제 #1
0
        private void ArrangeCall(Action <CallDuration> configuration)
        {
            var callDuration = new CallDuration
            {
                Id = _nextId++
            };

            configuration(callDuration);
            _dbContext.CallDurations.Add(callDuration);
            _dbContext.SaveChanges();
        }
        private void ArrangeRecord(bool isError, Action <CallOutcome> extraConfiguration = null)
        {
            var callOutcome = new CallOutcome {
                Id = _nextId++, EndTimestamp = DateTime.Now.AddSeconds(-1.0), IsError = isError
            };

            if (extraConfiguration != null)
            {
                extraConfiguration(callOutcome);
            }
            _context.CallOutcomes.Add(callOutcome);
            _context.SaveChanges();
        }