예제 #1
0
        /// <summary>
        /// Converts a <see cref="ProjectActivity"/> to a <see cref="ProjectSummaryActivity"/>.
        /// </summary>
        /// <param name="activity">The <see cref="ProjectActivity"/>.</param>
        /// <returns>
        /// The <see cref="ProjectSummaryActivity"/>.
        /// </returns>
        private static ProjectSummaryActivity Convert(ProjectActivity activity)
        {
            if (activity.IsBuilding())
            {
                return(ProjectSummaryActivity.Building);
            }

            if (activity.IsCheckingModifications())
            {
                return(ProjectSummaryActivity.CheckingModifications);
            }

            if (activity.IsPending())
            {
                return(ProjectSummaryActivity.Pending);
            }

            if (activity.IsSleeping())
            {
                return(ProjectSummaryActivity.Sleeping);
            }

            return(ProjectSummaryActivity.Unknown);
        }
        public void IsPendingReturnsFalseForNonPendingType()
        {
            ProjectActivity activity = ProjectActivity.CheckingModifications;

            Assert.IsFalse(activity.IsPending());
        }
        public void IsPendingReturnsTrueForPendingType()
        {
            ProjectActivity activity = ProjectActivity.Pending;

            Assert.IsTrue(activity.IsPending());
        }