예제 #1
0
        public void Pledges_FundPledges_PledgesFunded()
        {
            _pledges.Apply(new SetPledge(User1, 4, _now));

            var resp = _pledges.Apply(new FundPledges(_now.Plus(_settings.Frequency)));

            resp.AssertStatusIs(ResponseStatus.Succeeded);
            Assert.AreEqual(_now.Plus(_settings.Frequency), _pledges.Get(User1).FundedThrough);
            Assert.AreEqual(User1StartBalance - _settings.RatePerUnit * PledgeAmount, _accounts.Get(User1).Balance);
        }
        public void TaskInstances_ScheduleTasksForPastDate_InvalidState()
        {
            var resp = _taskInstances.Apply(new ScheduleWorkItemsThrough(_now.Plus(TimeSpan.FromDays(-1))));

            resp.AssertStatusIs(ResponseStatus.InvalidState);
        }
        public void TaskAssignments_AssignTask_TaskAssigned()
        {
            SetupSampleTasks();
            SetupSampleUsers();

            var resp = _assignments.Apply(new AssignTask(WeeklyTaskId, User1, _now.Plus(TimeSpan.FromDays(2))));

            Assert.IsTrue(resp.Succeeded);
            Assert.AreEqual(User1, _assignments.ForTask(WeeklyTaskId).ToUser(_now.Plus(TimeSpan.FromDays(2))));
        }