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; }
public void SetCode_UsingInvalidCode_ThrowsBusinessRuleException(string code) { //Arrange var invention = new Invention(); //Act TestDelegate testDelegate = () => invention.SetCode(code); //Assert Assert.Throws <BusinessRuleException>(testDelegate); }
public void SetCode_UsingValidCode_SetsCodeToInvention() { //Arrange var invention = new Invention(); //Act invention.SetCode("test0000"); //Assert Assert.IsTrue(invention.Code == "test0000"); }