public void CanCreateInstanceOfDailyActivity()
        {
            string id = DateTime.UtcNow.ToString("yyyy-MM-dd");
            DailyActivity instance = new DailyActivity(id);

            Assert.IsNotNull(instance);
            Assert.IsInstanceOf<Entity>(instance);
        }
        public void AddingAProcessIncrementsActiveCounter()
        {
            string id = DailyActivity.GetIdFrom(DateTime.UtcNow);
            DailyActivity activity = new DailyActivity(id);

            Guid processId = Guid.NewGuid();
            DateTime startedAt = DateTime.UtcNow;
            activity.AddProcess(processId, startedAt);

            Assert.AreEqual(1, activity.ActiveProcesses);
            Assert.AreEqual(1, activity.TotalProcessCount);
            Assert.AreEqual(0, activity.CompletionCount);
            Assert.AreEqual(0, activity.CompletedWithErrorCount);
        }
        public void CompletingAnExistingProcessDecrementsActiveCounter_ErrorCountIsNotZero()
        {
            string id = DailyActivity.GetIdFrom(DateTime.UtcNow);
            DailyActivity activity = new DailyActivity(id);

            Guid processId = Guid.NewGuid();
            DateTime startedAt = DateTime.UtcNow.AddSeconds(-10);
            activity.AddProcess(processId, startedAt);

            DateTime endedAt = DateTime.UtcNow;
            activity.EndProcess(processId, endedAt, true);

            Assert.AreEqual(0, activity.ActiveProcesses);
            Assert.AreEqual(1, activity.TotalProcessCount);
            Assert.AreEqual(1, activity.CompletionCount);
            Assert.AreEqual(1, activity.CompletedWithErrorCount);
        }