Ejemplo n.º 1
0
        public void RemoveRequirement_ForExistingRequriement_Should_Work()
        {
            //Arrange
            Demands demands = new Demands();

            demands.Add(new Requirements(eResourceType.Hardware, 5));
            demands.Add(new Requirements(eResourceType.Firmware, 15));
            demands.Add(new Requirements(eResourceType.Other, 25));
            demands.Add(new Requirements(eResourceType.Software, 15));

            demands.Remove(new Requirements(eResourceType.Other, 25));

            Assert.Equal(3, demands.Requirements.Count);
        }
Ejemplo n.º 2
0
        public void RemoveRequirement_ForNonExistingRequirement_Should_ThrowException()
        {
            //Arrange
            Demands demands = new Demands();

            demands.Add(new Requirements(eResourceType.Hardware, 5));
            demands.Add(new Requirements(eResourceType.Firmware, 15));

            //Remove nonexisting resource.
            Action removeRequirement = () => demands.Remove(new Requirements(eResourceType.Other, 10));

            //Act,Assert
            var exception = Assert.Throws <Exception>(removeRequirement);

            Assert.Equal("Requirements doesn't exist", exception.Message);
        }
 public void RemoveDemand(Demand demand)
 {
     _demands.Remove(demand);
     _openDemands.Remove(demand);
 }