示例#1
0
        public void Clone_ClonesObject_returnsShallowCopy()
        {
            //Arrange
            var recyclingMachine = new RecyclingMachine(0, 0, 16, 16, 1);

            //Act
            var recyclingMachineClone = recyclingMachine.Clone();

            //Assert
            Assert.ReferenceEquals(recyclingMachine, recyclingMachineClone);
        }
        public void PopulateListAsRecyclingMachines(Collection <Point> locations, int imageId)//int IMG (1 = first img; 2 = second img)
        {
            if (locations == null)
            {
                throw new ArgumentNullException("locations", "locations is NULL");
            }
            Machine recyclingMachine = new RecyclingMachine(0, 0, 16, 16, imageId);

            foreach (var item in locations)
            {
                Machines.Add(recyclingMachine.Clone());
                Machines.Last().PositionX = item.X;
                Machines.Last().PositionY = item.Y;
            }
        }