Ejemplo n.º 1
0
 public void Update(Invention inventionCategory, InventionDto dto)
 {
     inventionCategory.SetCode(dto.Code);
     inventionCategory.SetName(dto.Name);
     inventionCategory.Description = dto.Description;
     inventionCategory.CategoryId  = dto.CategoryId;
     inventionCategory.SetPrice(dto.Price);
     inventionCategory.Enable = dto.Enable;
 }
Ejemplo n.º 2
0
        public void SetPrice_UsingInvalidPrice_ThrowsBusinessRuleException(int price)
        {
            //Arrange
            var invention = new Invention();

            //Act
            TestDelegate testDelegate = () => invention.SetPrice(price);

            //Assert
            Assert.Throws <BusinessRuleException>(testDelegate);
        }
Ejemplo n.º 3
0
        public void SetPrice_UsingValidPrice_SetsPriceToInvention()
        {
            //Arrange
            var invention = new Invention();

            //Act
            invention.SetPrice(100);

            //Assert
            Assert.IsTrue(invention.Price == 100);
        }