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); }
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); }
public List<Box> Sort(Store store) { if (store == null) { throw new ArgumentException("Ссылка не указывает на объект"); } List<Box> boxes = store.Boxes; boxes.Sort((o1, o2) => { BoxService service = new BoxService(); double firstVolume = service.GetVolume(o1); double secondVolume = service.GetVolume(o2); return firstVolume.CompareTo(secondVolume); }); return boxes; }
public List <Box> Sort(Store store) { if (store == null) { throw new ArgumentException("Ссылка не указывает на объект"); } List <Box> boxes = store.Boxes; boxes.Sort((o1, o2) => { BoxService service = new BoxService(); double firstVolume = service.GetVolume(o1); double secondVolume = service.GetVolume(o2); return(firstVolume.CompareTo(secondVolume)); }); return(boxes); }
public void GetVolumeTestExeption() { BoxService target = new BoxService(); Box box = null; double actual = target.GetVolume(box); }
public void GetSurfaceSquareTestExeption() { BoxService target = new BoxService(); Box box = null; double actual = target.GetSurfaceSquare(box); }