Esempio n. 1
0
 public void GetSurfaceSquareTest()
 {
     BoxService target = new BoxService();
     Box box = new Box(1, 2, 3);
     double expected = 1 * 2 * 2 + 1 * 3 * 2 + 2 * 3 * 2;
     double actual = target.GetSurfaceSquare(box);
     Assert.AreEqual(expected, actual);
 }
Esempio n. 2
0
        public double GetVolume(Box box)
        {
            if (box == null)
            {
                throw new ArgumentException("Ссылка не указывает на объект теперь");
            }

            return box.Lenght * box.Width * box.Height;
        }
Esempio n. 3
0
 public void GetVolumeTest()
 {
     BoxService target = new BoxService();
     Box box = new Box(1, 2, 3);
     double expected = 6F;
     double actual;
     actual = target.GetVolume(box);
     Assert.AreEqual(expected, actual);
 }
Esempio n. 4
0
        public double GetSurfaceSquare(Box box)
        {
            if (box == null)
            {
                throw new ArgumentException("Ссылка не указывает на объект");
            }

            return (box.Height * box.Lenght) * 2 +
                (box.Height * box.Width) * 2 +
                (box.Lenght * box.Width) * 2;
        }
Esempio n. 5
0
        public void SortTest()
        {
            Store store = new Store(); // TODO: инициализация подходящего значения
            Box minBox = new Box(1, 1, 1);
            Box middleBox = new Box(1, 2, 1);
            Box maxBox = new Box(1, 2, 2);
            store.Add(maxBox);
            store.Add(minBox);
            store.Add(middleBox);

            StoreService target = new StoreService();
            target.Sort(store);

            List<Box> expected = new List<Box>() { minBox, middleBox, maxBox };

            List<Box> actual;
            actual = target.Sort(store);
            CollectionAssert.AreEqual(expected, actual);
        }
Esempio n. 6
0
 public void Add(Box box)
 {
     _boxes.Add(box);
 }
Esempio n. 7
0
 static void Main(string[] args)
 {
     Box box = new Box(1, 2, 3);
     Console.WriteLine(box);
     Console.ReadKey();
 }