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.
52 lines
1.7 KiB
52 lines
1.7 KiB
using Entities;
|
|
|
|
namespace TestEF;
|
|
|
|
public class TestInquiryTableEntity
|
|
{
|
|
private const int _inquiryId = 42;
|
|
private static InquiryEntity _inquiry = new InquiryEntity();
|
|
private const string _databaseName = "Database";
|
|
private const string _connectionInfo = "Connection";
|
|
|
|
[Fact]
|
|
public void TestDefaultConstructor()
|
|
{
|
|
InquiryTableEntity tableEntity = new InquiryTableEntity();
|
|
Assert.Equal(0, tableEntity.OwnerId);
|
|
Assert.Null(tableEntity.Owner);
|
|
Assert.Null(tableEntity.DatabaseName);
|
|
Assert.Null(tableEntity.ConnectionInfo);
|
|
}
|
|
|
|
[Fact]
|
|
public void TestConstructorWithOnlyId()
|
|
{
|
|
InquiryTableEntity tableEntity = new InquiryTableEntity(_inquiryId);
|
|
Assert.Equal(_inquiryId, tableEntity.OwnerId);
|
|
Assert.Null(tableEntity.Owner);
|
|
Assert.Null(tableEntity.DatabaseName);
|
|
Assert.Null(tableEntity.ConnectionInfo);
|
|
}
|
|
|
|
|
|
[Fact]
|
|
public void TestConstructorWithoutId()
|
|
{
|
|
InquiryTableEntity tableEntity = new InquiryTableEntity(_inquiry, _databaseName, _connectionInfo);
|
|
Assert.Equal(0, tableEntity.OwnerId);
|
|
Assert.Equal(_inquiry, tableEntity.Owner);
|
|
Assert.Equal(_databaseName, tableEntity.DatabaseName);
|
|
Assert.Equal(_connectionInfo, tableEntity.ConnectionInfo);
|
|
}
|
|
|
|
[Fact]
|
|
public void TestConstructorWithoutNavigationProperty()
|
|
{
|
|
InquiryTableEntity tableEntity = new InquiryTableEntity(_inquiryId, _databaseName, _connectionInfo);
|
|
Assert.Equal(_inquiryId, tableEntity.OwnerId);
|
|
Assert.Null(tableEntity.Owner);
|
|
Assert.Equal(_databaseName, tableEntity.DatabaseName);
|
|
Assert.Equal(_connectionInfo, tableEntity.ConnectionInfo);
|
|
}
|
|
} |