|
|
|
@ -1,20 +1,20 @@
|
|
|
|
|
using Entities;
|
|
|
|
|
|
|
|
|
|
namespace TestEF;
|
|
|
|
|
namespace TestEF.EntitiesTests;
|
|
|
|
|
|
|
|
|
|
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";
|
|
|
|
|
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();
|
|
|
|
|
var paragraph = new ParagraphEntity();
|
|
|
|
|
Assert.Equal(0, paragraph.Id);
|
|
|
|
|
Assert.Null(paragraph.Title);
|
|
|
|
|
Assert.Null(paragraph.Info);
|
|
|
|
@ -26,25 +26,41 @@ public class TestParagraphEntity
|
|
|
|
|
[Fact]
|
|
|
|
|
public void TestConstructorWithoutId()
|
|
|
|
|
{
|
|
|
|
|
ParagraphEntity paragraph = new ParagraphEntity(_title,_content,_info,_query,_comment);
|
|
|
|
|
var paragraph = new ParagraphEntity
|
|
|
|
|
{
|
|
|
|
|
Title = Title,
|
|
|
|
|
Content = Content,
|
|
|
|
|
Info = Info,
|
|
|
|
|
Query = Query,
|
|
|
|
|
Comment = 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);
|
|
|
|
|
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,10);
|
|
|
|
|
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);
|
|
|
|
|
var paragraph = new ParagraphEntity
|
|
|
|
|
{
|
|
|
|
|
Id = Id,
|
|
|
|
|
Title = Title,
|
|
|
|
|
Content = Content,
|
|
|
|
|
Info = Info,
|
|
|
|
|
Query = Query,
|
|
|
|
|
Comment = Comment,
|
|
|
|
|
LessonId = 10
|
|
|
|
|
};
|
|
|
|
|
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);
|
|
|
|
|
Assert.Equal(10, paragraph.LessonId);
|
|
|
|
|
}
|
|
|
|
|
}
|