Пример #1
0
        /// <summary>アクティビティを定義する</summary>
        /// <param name="id">ID</param>
        /// <param name="name">名称</param>
        /// <param name="externalCost">支出</param>
        /// <param name="income">収入</param>
        /// <param name="fixTime">固定時間</param>
        /// <param name="workLoad">作業量</param>
        /// <param name="failRate">失敗確率</param>
        /// <param name="reworkRate">リワーク確率</param>
        /// <param name="costOverRate">コスト超過確率</param>
        /// <returns></returns>
        public static Activity Define(
            string id            = null,
            string name          = null,
            decimal externalCost = 0m,
            decimal income       = 0m,
            decimal fixTime      = 0m,
            decimal workLoad     = 0m,
            decimal failRate     = 0m,
            decimal reworkRate   = 0m,
            decimal costOverRate = 0m)
        {
            Contract.Requires(!id.IsNullOrEmpty());
            Contract.Requires(!name.IsNullOrEmpty());

            var activity = new Activity()
            {
                Id   = id,
                Name = name,
            };

            activity.Estimate(Cost.Of(externalCost));
            activity.Estimate(Income.Of(income));
            activity.Estimate(LeadTime.Of(fixTime));
            activity.Estimate(WorkLoad.Of(workLoad));
            activity.Estimate(Risk.Of(failRate: failRate, reworkRate: reworkRate, costOverRate: costOverRate));
            return(activity);
        }
Пример #2
0
        public static Activity Activity(
            decimal income               = 0m,
            decimal externalCost         = 0m,
            decimal failRate             = 0m,
            decimal reworkRate           = 0m,
            decimal costoverRate         = 0m,
            State state                  = State.ToDo,
            decimal fixTime              = 0m,
            decimal workLoad             = 0m,
            decimal resourceQuantity     = 0m,
            decimal resourceProductivity = 0m
            )
        {
            var activity = new Activity();

            activity.Estimate(Income.Of(income));
            activity.Estimate(Cost.Of(externalCost));
            activity.Estimate(Risk.Of(failRate, reworkRate, costoverRate));
            activity.Estimate(LeadTime.Of(fixTime));
            activity.Estimate(WorkLoad.Of(workLoad));
            if (resourceQuantity != 0m && resourceProductivity != 0m)
            {
                activity.Assign(new[] { Resource.Of(resourceQuantity, resourceProductivity) });
            }
            activity.Progress(state);
            return(activity);
        }
Пример #3
0
        public void 見積後のアクティビティの収入は与えられたものであるべき()
        {
            var expectedValue = 100m;
            var activity      = Activity.Define();

            activity.Estimate(Income.Of(expectedValue));
            activity.Income.Value.Is(expectedValue);
        }