コード例 #1
0
        public IAdjustableChair CreateAdjustableChair(string model, string materialType, decimal price, decimal height, int numberOfLegs)
        {
            // TODO: Implement this method
            IAdjustableChair chair = new AdjustableChair(height, materialType, model, price, numberOfLegs);

            return(chair);
        }
コード例 #2
0
        public IAdjustableChair CreateAdjustableChair(string model,
                                                      string materialType, decimal price, decimal height, int numberOfLegs)
        {
            MaterialType    matType = GetMaterialType(materialType);
            AdjustableChair chair   = new AdjustableChair(model, matType, price, height, numberOfLegs);

            return(chair);
        }
コード例 #3
0
        public void SetHeight_WhenSetHeightWithValidDataIsPassed()
        {
            var adjustableChair = new AdjustableChair("Visage", "Wood", 65, 1.20m, 4);

            adjustableChair.SetHeight(0.10m);

            Assert.AreEqual(0.10, adjustableChair.Height);
        }
コード例 #4
0
        public void NotSetHeight_WhenInvalidHeightIsPassed(decimal height)
        {
            var adjustableChair = new AdjustableChair("Visage", "Wood", 65, 1.20m, 4);

            adjustableChair.SetHeight(height);

            Assert.AreEqual(1.20, adjustableChair.Height);
        }
コード例 #5
0
ファイル: FurnitureFactory.cs プロジェクト: paveldk/Telerik
 public IAdjustableChair CreateAdjustableChair(string model, string materialType, decimal price, decimal height, int numberOfLegs)
 {
     if (!adjustableChairs.Contains(model))
     {
         var adjustableChair = new AdjustableChair(model, materialType, price, height, numberOfLegs);
         adjustableChairs.Add(model);
         return(adjustableChair);
     }
     else
     {
         throw new Exception("Adjustable Chair with this model is already added");
     }
 }
コード例 #6
0
ファイル: FurnitureFactory.cs プロジェクト: StanDimitroff/CS
        public IAdjustableChair CreateAdjustableChair(
            string model,
            string materialType,
            decimal price,
            decimal height,
            int numberOfLegs)
        {
            IAdjustableChair adjustableChair = new AdjustableChair(
                model,
                this.GetMaterialType(materialType),
                price,
                height,
                numberOfLegs);

            return(adjustableChair);
        }