public static RainbarrelSmallModel generateSmallRainbarrel()
        {
            RainbarrelSmallModel smallbarrel = new RainbarrelSmallModel();

            smallbarrel.id = Guid.NewGuid().ToString();
            smallbarrel.CurrentContentValue = 80;
            smallbarrel.MaxCapacity         = 80;
            return(smallbarrel);
        }
Ejemplo n.º 2
0
        public bool AddSmallRainBarrelToContainer(RainbarrelSmallModel smallbarrel)
        {
            bool found = false;

            if (!_containers.Any())
            {
                var item = new ContainerModel
                {
                    id = Guid.NewGuid().ToString(),
                    CurrentContentValue = smallbarrel.MaxCapacity,
                    SmallRainBarrelsStoredInsideThisContainer = new List <RainbarrelSmallModel>
                    {
                        smallbarrel
                    }
                };
                StaticResources.CurrentStaticContainer.currentContainer = item;
                _containers.Add(item);
                Console.WriteLine("Small rainbarrel and container added");
            }
            foreach (var item in _containers)
            {
                if (found == false)
                {
                    if (item.MaxCapacity > item.CurrentContentValue)
                    {
                        item.SmallRainBarrelsStoredInsideThisContainer.Add(smallbarrel);
                        item.CurrentContentValue = smallbarrel.MaxCapacity;
                        found = true;
                        Console.WriteLine("Small rainbarrel added");
                    }
                }
            }
            if (found == false)
            {
                ContainerModel item = new ContainerModel();
                ContainerAbstractionStructure.containers = new List <ContainerModel>();
                ContainerAbstractionStructure.containers.Add(item);
                item.id = Guid.NewGuid().ToString();
                item.SmallRainBarrelsStoredInsideThisContainer = new List <RainbarrelSmallModel>();
                item.SmallRainBarrelsStoredInsideThisContainer.Add(smallbarrel);
                item.CurrentContentValue = smallbarrel.MaxCapacity;
                _containers.Add(item);
                Console.WriteLine("Medium rainbarrel and container added");
            }

            return(true);
        }
Ejemplo n.º 3
0
        public void CheckifCapacityIsCorrectSmall(int valuetocompareto)
        {
            RainbarrelSmallModel smallbarrel = new RainbarrelSmallModel();

            Assert.AreEqual(smallbarrel.MaxCapacity, valuetocompareto, "Values match with the given content type");
        }
Ejemplo n.º 4
0
 public void generateSmallBarrel()
 {
     RainbarrelSmallModel small = new RainbarrelSmallModel();
 }
Ejemplo n.º 5
0
 public bool FillSmallRainBarrel(RainbarrelSmallModel smallmodel)
 {
     smallmodel.CurrentContentValue = smallmodel.MaxCapacity;
     Console.WriteLine("Small rainbarrel filled");
     return(true);
 }
Ejemplo n.º 6
0
 public bool emptySmallRainBarrel(RainbarrelSmallModel smallmodel)
 {
     smallmodel.CurrentContentValue = 0;
     Console.WriteLine("Small rainbarrel emptied");
     return(true);
 }