예제 #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;
 }
예제 #2
0
        public void SetCode_UsingInvalidCode_ThrowsBusinessRuleException(string code)
        {
            //Arrange
            var invention = new Invention();

            //Act
            TestDelegate testDelegate = () => invention.SetCode(code);

            //Assert
            Assert.Throws <BusinessRuleException>(testDelegate);
        }
예제 #3
0
        public void SetCode_UsingValidCode_SetsCodeToInvention()
        {
            //Arrange
            var invention = new Invention();

            //Act
            invention.SetCode("test0000");

            //Assert
            Assert.IsTrue(invention.Code == "test0000");
        }