public void GivenCommentAttributeWithId_WhenSearchingById_ShouldBeSameAsTheAddedOne() { NewElement element = AttributesMapperSettersTests.InitializeEmptyNewElement(); int id = 5; var att = new CommentAttribute() { Id = id }; element.CommentAttributes.Add(att); var foundAttribute = AttributesMapper.GetAttributeById <CommentAttribute>(element, id); foundAttribute.Should().Be(att); }
public void GivenCommentAttributeWithId_WhenSearchingById_ShouldNotThrow() { NewElement element = AttributesMapperSettersTests.InitializeEmptyNewElement(); int id = 5; var att = new CommentAttribute() { Id = id }; element.CommentAttributes.Add(att); Action a = () => AttributesMapper.GetAttributeById <CommentAttribute>(element, id); a.Should().NotThrow <FieldNotFoundException>(); }