示例#1
0
        public void ParseCriteriaSampleIdNotZero_Test()
        {
            // Arrrange
            CriteriaSampleDTO criteriaSampleDTO = new CriteriaSampleDTO()
            {
                Id   = 2,
                Name = "Name",
                CostConstraintImpactId    = 1,
                TimeConstraintImpactId    = 1,
                QualityConstraintImpactId = 1,
                ScopeConstraintImpactId   = 1
            };

            // Act
            CriteriaSample criteriaSample = factory.Parse(criteriaSampleDTO);

            // Assert
            Assert.True(criteriaSample != null &&
                        criteriaSample.Id == criteriaSampleDTO.Id &&
                        criteriaSample.Name == criteriaSampleDTO.Name &&
                        criteriaSample.QualityConstraintImpactId == criteriaSampleDTO.QualityConstraintImpactId &&
                        criteriaSample.ScopeConstraintImpactId == criteriaSampleDTO.ScopeConstraintImpactId &&
                        criteriaSample.CostConstraintImpactId == criteriaSampleDTO.CostConstraintImpactId &&
                        criteriaSample.TimeConstraintImpactId == criteriaSampleDTO.TimeConstraintImpactId);
        }
示例#2
0
        private CriteriaSample ParseForAdd(CriteriaSampleDTO criteriaSampleDTO)
        {
            if (criteriaSampleDTO != null)
            {
                var criteriaSample = new CriteriaSample()
                {
                    Name   = criteriaSampleDTO.Name,
                    AreaId = criteriaSampleDTO.AreaId,
                    CostConstraintImpactId = criteriaSampleDTO.CostConstraintImpactId
                };

                if (criteriaSampleDTO.Id != 0)
                {
                    criteriaSample.QualityConstraintImpactId = defaultConstraintId;
                    criteriaSample.ScopeConstraintImpactId   = defaultConstraintId;
                    criteriaSample.TimeConstraintImpactId    = defaultConstraintId;
                }
                else
                {
                    criteriaSample.QualityConstraintImpactId = defaultConstraintId;
                    criteriaSample.TimeConstraintImpactId    = defaultConstraintId;
                    criteriaSample.ScopeConstraintImpactId   = defaultConstraintId;
                }

                return(criteriaSample);
            }
            else
            {
                throw new NotSupportedException("BAD GATEWAY!!! \n ADD operation temporary NOT SUPPORTED!!!");
            }
        }
示例#3
0
        public void ParseCriteriaSampleParameterNull_Test()
        {
            // Arrange
            CriteriaSampleDTO criteriaSampleDTO = null;

            // Act
            CriteriaSample criteriaSample = factory.Parse(criteriaSampleDTO);
        }
示例#4
0
 public CriteriaSampleDTO Create(CriteriaSample criteriaSample)
 {
     return(new CriteriaSampleDTO()
     {
         Id = criteriaSample.Id,
         Name = criteriaSample.Name,
         AreaId = criteriaSample.AreaId,
         ScopeConstraintImpactId = criteriaSample.ScopeConstraintImpactId,
         TimeConstraintImpactId = criteriaSample.TimeConstraintImpactId,
         QualityConstraintImpactId = criteriaSample.QualityConstraintImpactId,
         CostConstraintImpactId = criteriaSample.CostConstraintImpactId
     });
 }