You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
API_SQLuedo/API_SQLuedo/TestEF/EntitiesTests/TestParagraphEntity.cs

61 lines
1.9 KiB

using Entities;
namespace TestEF;
public class TestParagraphEntity
{
private const int _id = 42;
private const string _title = "Title";
private const string _info = "Info";
private const string _content = "Content";
private const string _query = "Query";
private const string _comment = "Comment";
[Fact]
public void TestDefaultConstructor()
{
ParagraphEntity paragraph = new ParagraphEntity();
Assert.Equal(0, paragraph.Id);
Assert.Null(paragraph.Title);
Assert.Null(paragraph.Info);
Assert.Null(paragraph.Content);
Assert.Null(paragraph.Query);
Assert.Null(paragraph.Comment);
}
[Fact]
public void TestConstructorWithOnlyId()
{
ParagraphEntity paragraph = new ParagraphEntity(_id);
Assert.Equal(_id, paragraph.Id);
Assert.Null(paragraph.Title);
Assert.Null(paragraph.Info);
Assert.Null(paragraph.Content);
Assert.Null(paragraph.Query);
Assert.Null(paragraph.Comment);
}
[Fact]
public void TestConstructorWithoutId()
{
ParagraphEntity paragraph = new ParagraphEntity(_title,_content,_info,_query,_comment);
Assert.Equal(0, paragraph.Id);
Assert.Equal(_title,paragraph.Title);
Assert.Equal(_info,paragraph.Info);
Assert.Equal(_content,paragraph.Content);
Assert.Equal(_query,paragraph.Query);
Assert.Equal(_comment,paragraph.Comment);
}
[Fact]
public void TestConstructorWithAllAttributes()
{
ParagraphEntity paragraph = new ParagraphEntity(_id,_title,_content,_info,_query,_comment);
Assert.Equal(_id, paragraph.Id);
Assert.Equal(_title,paragraph.Title);
Assert.Equal(_info,paragraph.Info);
Assert.Equal(_content,paragraph.Content);
Assert.Equal(_query,paragraph.Query);
Assert.Equal(_comment,paragraph.Comment);
}
}