|
|
|
@ -1,15 +1,15 @@
|
|
|
|
|
using Entities;
|
|
|
|
|
|
|
|
|
|
namespace TestEF;
|
|
|
|
|
namespace TestEF.EntitiesTests;
|
|
|
|
|
|
|
|
|
|
public class TestNotepadEntity
|
|
|
|
|
{
|
|
|
|
|
private const int _id = 42;
|
|
|
|
|
private const int _userId = 42;
|
|
|
|
|
private static UserEntity _userEntity = new UserEntity();
|
|
|
|
|
private const int _inquiryId = 42;
|
|
|
|
|
private static InquiryEntity _inquiryEntity = new InquiryEntity();
|
|
|
|
|
private const string _notes = "This is some notes example";
|
|
|
|
|
private const int Id = 42;
|
|
|
|
|
private const int UserId = 42;
|
|
|
|
|
private static readonly UserEntity UserEntity = new();
|
|
|
|
|
private const int InquiryId = 42;
|
|
|
|
|
private static readonly InquiryEntity InquiryEntity = new();
|
|
|
|
|
private const string Notes = "This is some notes example";
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void TestDefaultConstructor()
|
|
|
|
@ -26,24 +26,39 @@ public class TestNotepadEntity
|
|
|
|
|
[Fact]
|
|
|
|
|
public void TestConstructorWithoutId()
|
|
|
|
|
{
|
|
|
|
|
NotepadEntity notepad = new NotepadEntity(_userId,_userEntity,_inquiryId,_inquiryEntity,_notes);
|
|
|
|
|
NotepadEntity notepad = new NotepadEntity
|
|
|
|
|
{
|
|
|
|
|
UserId = UserId,
|
|
|
|
|
User = UserEntity,
|
|
|
|
|
InquiryId = InquiryId,
|
|
|
|
|
Inquiry = InquiryEntity,
|
|
|
|
|
Notes = Notes
|
|
|
|
|
};
|
|
|
|
|
Assert.Equal(0, notepad.Id);
|
|
|
|
|
Assert.Equal(_userId,notepad.UserId);
|
|
|
|
|
Assert.Equal(_userEntity,notepad.User);
|
|
|
|
|
Assert.Equal(_inquiryId,notepad.InquiryId);
|
|
|
|
|
Assert.Equal(_inquiryEntity,notepad.Inquiry);
|
|
|
|
|
Assert.Equal(_notes,notepad.Notes);
|
|
|
|
|
Assert.Equal(UserId, notepad.UserId);
|
|
|
|
|
Assert.Equal(UserEntity, notepad.User);
|
|
|
|
|
Assert.Equal(InquiryId, notepad.InquiryId);
|
|
|
|
|
Assert.Equal(InquiryEntity, notepad.Inquiry);
|
|
|
|
|
Assert.Equal(Notes, notepad.Notes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void TestConstructorWithAllAttributes()
|
|
|
|
|
{
|
|
|
|
|
NotepadEntity notepad = new NotepadEntity(_id,_userId,_userEntity,_inquiryId,_inquiryEntity,_notes);
|
|
|
|
|
Assert.Equal(_id,notepad.Id);
|
|
|
|
|
Assert.Equal(_userId,notepad.UserId);
|
|
|
|
|
Assert.Equal(_userEntity,notepad.User);
|
|
|
|
|
Assert.Equal(_inquiryId,notepad.InquiryId);
|
|
|
|
|
Assert.Equal(_inquiryEntity,notepad.Inquiry);
|
|
|
|
|
Assert.Equal(_notes,notepad.Notes);
|
|
|
|
|
NotepadEntity notepad = new NotepadEntity
|
|
|
|
|
{
|
|
|
|
|
Id = Id,
|
|
|
|
|
UserId = UserId,
|
|
|
|
|
User = UserEntity,
|
|
|
|
|
InquiryId = InquiryId,
|
|
|
|
|
Inquiry = InquiryEntity,
|
|
|
|
|
Notes = Notes
|
|
|
|
|
};
|
|
|
|
|
Assert.Equal(Id, notepad.Id);
|
|
|
|
|
Assert.Equal(UserId, notepad.UserId);
|
|
|
|
|
Assert.Equal(UserEntity, notepad.User);
|
|
|
|
|
Assert.Equal(InquiryId, notepad.InquiryId);
|
|
|
|
|
Assert.Equal(InquiryEntity, notepad.Inquiry);
|
|
|
|
|
Assert.Equal(Notes, notepad.Notes);
|
|
|
|
|
}
|
|
|
|
|
}
|