tests: add simple tests for entities
This commit is contained in:
@@ -0,0 +1,85 @@
|
|||||||
|
namespace SanctionsSearch.Worker.Tests.Unit;
|
||||||
|
|
||||||
|
public class AddressTests
|
||||||
|
{
|
||||||
|
[Fact]
|
||||||
|
public void SdnId_SetValue_ShouldGetSameValue()
|
||||||
|
{
|
||||||
|
var address = new Address();
|
||||||
|
address.SdnId = 123;
|
||||||
|
address.SdnId.Should().Be(123);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void StreetAddress_SetValue_ShouldGetSameValue()
|
||||||
|
{
|
||||||
|
var address = new Address();
|
||||||
|
address.StreetAddress = "123 Main St";
|
||||||
|
address.StreetAddress.Should().Be("123 Main St");
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void CityProvincePostal_SetValue_ShouldGetSameValue()
|
||||||
|
{
|
||||||
|
var address = new Address();
|
||||||
|
address.CityProvincePostal = "City, Province, Postal";
|
||||||
|
address.CityProvincePostal.Should().Be("City, Province, Postal");
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Country_SetValue_ShouldGetSameValue()
|
||||||
|
{
|
||||||
|
var address = new Address();
|
||||||
|
address.Country = "CountryName";
|
||||||
|
address.Country.Should().Be("CountryName");
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Remarks_SetValue_ShouldGetSameValue()
|
||||||
|
{
|
||||||
|
var address = new Address();
|
||||||
|
address.Remarks = "Some remarks";
|
||||||
|
address.Remarks.Should().Be("Some remarks");
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Sdn_SetValue_ShouldGetSameValue()
|
||||||
|
{
|
||||||
|
var address = new Address();
|
||||||
|
var sdn = new Sdn();
|
||||||
|
address.Sdn = sdn;
|
||||||
|
address.Sdn.Should().Be(sdn);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Constructor_DefaultValues_ShouldBeSet()
|
||||||
|
{
|
||||||
|
var address = new Address();
|
||||||
|
address.StreetAddress.Should().Be(string.Empty);
|
||||||
|
address.CityProvincePostal.Should().Be(string.Empty);
|
||||||
|
address.Country.Should().Be(string.Empty);
|
||||||
|
address.Remarks.Should().Be(string.Empty);
|
||||||
|
address.Sdn.Should().Be(default);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Constructor_WhenInitializingProperties_ShouldSetProperties()
|
||||||
|
{
|
||||||
|
var address = new Address
|
||||||
|
{
|
||||||
|
SdnId = 123,
|
||||||
|
StreetAddress = "123 Main St",
|
||||||
|
CityProvincePostal = "City, Province, Postal",
|
||||||
|
Country = "CountryName",
|
||||||
|
Remarks = "Some remarks",
|
||||||
|
Sdn = new Sdn()
|
||||||
|
};
|
||||||
|
|
||||||
|
address.SdnId.Should().Be(123);
|
||||||
|
address.StreetAddress.Should().Be("123 Main St");
|
||||||
|
address.CityProvincePostal.Should().Be("City, Province, Postal");
|
||||||
|
address.Country.Should().Be("CountryName");
|
||||||
|
address.Remarks.Should().Be("Some remarks");
|
||||||
|
address.Sdn.Should().NotBeNull();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
namespace SanctionsSearch.Worker.Tests.Unit;
|
||||||
|
|
||||||
|
public class AliasTests
|
||||||
|
{
|
||||||
|
[Fact]
|
||||||
|
public void SdnId_SetValue_ShouldGetSameValue()
|
||||||
|
{
|
||||||
|
var alias = new Alias();
|
||||||
|
alias.SdnId = 123;
|
||||||
|
alias.SdnId.Should().Be(123);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Type_SetValue_ShouldGetSameValue()
|
||||||
|
{
|
||||||
|
var alias = new Alias();
|
||||||
|
alias.Type = "Type";
|
||||||
|
alias.Type.Should().Be("Type");
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Name_SetValue_ShouldGetSameValue()
|
||||||
|
{
|
||||||
|
var alias = new Alias();
|
||||||
|
alias.Name = "Name";
|
||||||
|
alias.Name.Should().Be("Name");
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Remarks_SetValue_ShouldGetSameValue()
|
||||||
|
{
|
||||||
|
var alias = new Alias();
|
||||||
|
alias.Remarks = "Some remarks";
|
||||||
|
alias.Remarks.Should().Be("Some remarks");
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Sdn_SetValue_ShouldGetSameValue()
|
||||||
|
{
|
||||||
|
var alias = new Alias();
|
||||||
|
var sdn = new Sdn();
|
||||||
|
alias.Sdn = sdn;
|
||||||
|
alias.Sdn.Should().Be(sdn);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Constructor_DefaultValues_ShouldBeSet()
|
||||||
|
{
|
||||||
|
var alias = new Alias();
|
||||||
|
alias.Type.Should().Be(string.Empty);
|
||||||
|
alias.Name.Should().Be(string.Empty);
|
||||||
|
alias.Remarks.Should().Be(string.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Constructor_WhenInitializingProperties_ShouldSetProperties()
|
||||||
|
{
|
||||||
|
var alias = new Alias
|
||||||
|
{
|
||||||
|
SdnId = 123,
|
||||||
|
Type = "Type",
|
||||||
|
Name = "Name",
|
||||||
|
Remarks = "Remarks"
|
||||||
|
};
|
||||||
|
|
||||||
|
alias.SdnId.Should().Be(123);
|
||||||
|
alias.Type.Should().Be("Type");
|
||||||
|
alias.Name.Should().Be("Name");
|
||||||
|
alias.Remarks.Should().Be("Remarks");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
namespace SanctionsSearch.Worker.Tests.Unit;
|
||||||
|
|
||||||
|
public class CommentTests
|
||||||
|
{
|
||||||
|
[Fact]
|
||||||
|
public void SdnId_SetValue_ShouldGetSameValue()
|
||||||
|
{
|
||||||
|
var comment = new Comment();
|
||||||
|
comment.SdnId = 123;
|
||||||
|
comment.SdnId.Should().Be(123);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Remarks_SetValue_ShouldGetSameValue()
|
||||||
|
{
|
||||||
|
var comment = new Comment();
|
||||||
|
comment.Remarks = "Some remarks";
|
||||||
|
comment.Remarks.Should().Be("Some remarks");
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Sdn_SetValue_ShouldGetSameValue()
|
||||||
|
{
|
||||||
|
var comment = new Comment();
|
||||||
|
var sdn = new Sdn();
|
||||||
|
comment.Sdn = sdn;
|
||||||
|
comment.Sdn.Should().Be(sdn);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Constructor_DefaultValues_ShouldBeSet()
|
||||||
|
{
|
||||||
|
var comment = new Comment();
|
||||||
|
comment.Remarks.Should().Be(string.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Constructor_WhenInitializingProperties_ShouldSetProperties()
|
||||||
|
{
|
||||||
|
var comment = new Comment
|
||||||
|
{
|
||||||
|
SdnId = 123,
|
||||||
|
Remarks = "Some remarks"
|
||||||
|
};
|
||||||
|
|
||||||
|
comment.SdnId.Should().Be(123);
|
||||||
|
comment.Remarks.Should().Be("Some remarks");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,152 @@
|
|||||||
|
namespace SanctionsSearch.Worker.Tests.Unit;
|
||||||
|
|
||||||
|
public class SdnTests
|
||||||
|
{
|
||||||
|
[Fact]
|
||||||
|
public void Name_SetValue_ShouldGetSameValue()
|
||||||
|
{
|
||||||
|
var sdn = new Sdn();
|
||||||
|
sdn.Name = "Name";
|
||||||
|
sdn.Name.Should().Be("Name");
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Type_SetValue_ShouldGetSameValue()
|
||||||
|
{
|
||||||
|
var sdn = new Sdn();
|
||||||
|
sdn.Type = "Type";
|
||||||
|
sdn.Type.Should().Be("Type");
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Program_SetValue_ShouldGetSameValue()
|
||||||
|
{
|
||||||
|
var sdn = new Sdn();
|
||||||
|
sdn.Program = "Program";
|
||||||
|
sdn.Program.Should().Be("Program");
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Title_SetValue_ShouldGetSameValue()
|
||||||
|
{
|
||||||
|
var sdn = new Sdn();
|
||||||
|
sdn.Title = "Title";
|
||||||
|
sdn.Title.Should().Be("Title");
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void CallSign_SetValue_ShouldGetSameValue()
|
||||||
|
{
|
||||||
|
var sdn = new Sdn();
|
||||||
|
sdn.CallSign = "CallSign";
|
||||||
|
sdn.CallSign.Should().Be("CallSign");
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void VesselType_SetValue_ShouldGetSameValue()
|
||||||
|
{
|
||||||
|
var sdn = new Sdn();
|
||||||
|
sdn.VesselType = "VesselType";
|
||||||
|
sdn.VesselType.Should().Be("VesselType");
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Tonnage_SetValue_ShouldGetSameValue()
|
||||||
|
{
|
||||||
|
var sdn = new Sdn();
|
||||||
|
sdn.Tonnage = "Tonnage";
|
||||||
|
sdn.Tonnage.Should().Be("Tonnage");
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void GrossRegisteredTonnage_SetValue_ShouldGetSameValue()
|
||||||
|
{
|
||||||
|
var sdn = new Sdn();
|
||||||
|
sdn.GrossRegisteredTonnage = "GrossRegisteredTonnage";
|
||||||
|
sdn.GrossRegisteredTonnage.Should().Be("GrossRegisteredTonnage");
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void VesselFlag_SetValue_ShouldGetSameValue()
|
||||||
|
{
|
||||||
|
var sdn = new Sdn();
|
||||||
|
sdn.VesselFlag = "VesselFlag";
|
||||||
|
sdn.VesselFlag.Should().Be("VesselFlag");
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void VesselOwner_SetValue_ShouldGetSameValue()
|
||||||
|
{
|
||||||
|
var sdn = new Sdn();
|
||||||
|
sdn.VesselOwner = "VesselOwner";
|
||||||
|
sdn.VesselOwner.Should().Be("VesselOwner");
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Remarks_SetValue_ShouldGetSameValue()
|
||||||
|
{
|
||||||
|
var sdn = new Sdn();
|
||||||
|
sdn.Remarks = "Some remarks";
|
||||||
|
sdn.Remarks.Should().Be("Some remarks");
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Aliases_SetValue_ShouldGetSameValue()
|
||||||
|
{
|
||||||
|
var sdn = new Sdn();
|
||||||
|
var aliases = new List<Alias>();
|
||||||
|
sdn.Aliases = aliases;
|
||||||
|
sdn.Aliases.Should().BeSameAs(aliases);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Constructor_DefaultValues_ShouldBeSet()
|
||||||
|
{
|
||||||
|
var sdn = new Sdn();
|
||||||
|
sdn.Name.Should().Be(string.Empty);
|
||||||
|
sdn.Type.Should().Be(string.Empty);
|
||||||
|
sdn.Program.Should().Be(string.Empty);
|
||||||
|
sdn.Title.Should().Be(string.Empty);
|
||||||
|
sdn.CallSign.Should().Be(string.Empty);
|
||||||
|
sdn.VesselType.Should().Be(string.Empty);
|
||||||
|
sdn.Tonnage.Should().Be(string.Empty);
|
||||||
|
sdn.GrossRegisteredTonnage.Should().Be(string.Empty);
|
||||||
|
sdn.VesselFlag.Should().Be(string.Empty);
|
||||||
|
sdn.VesselOwner.Should().Be(string.Empty);
|
||||||
|
sdn.Remarks.Should().Be(string.Empty);
|
||||||
|
sdn.Aliases.Should().BeEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Constructor_WhenInitializingProperties_ShouldSetProperties()
|
||||||
|
{
|
||||||
|
var sdn = new Sdn
|
||||||
|
{
|
||||||
|
Name = "Name",
|
||||||
|
Type = "Type",
|
||||||
|
Program = "Program",
|
||||||
|
Title = "Title",
|
||||||
|
CallSign = "CallSign",
|
||||||
|
VesselType = "VesselType",
|
||||||
|
Tonnage = "Tonnage",
|
||||||
|
GrossRegisteredTonnage = "GrossRegisteredTonnage",
|
||||||
|
VesselFlag = "VesselFlag",
|
||||||
|
VesselOwner = "VesselOwner",
|
||||||
|
Remarks = "Remarks",
|
||||||
|
Aliases = new List<Alias>()
|
||||||
|
};
|
||||||
|
|
||||||
|
sdn.Name.Should().Be("Name");
|
||||||
|
sdn.Type.Should().Be("Type");
|
||||||
|
sdn.Program.Should().Be("Program");
|
||||||
|
sdn.Title.Should().Be("Title");
|
||||||
|
sdn.CallSign.Should().Be("CallSign");
|
||||||
|
sdn.VesselType.Should().Be("VesselType");
|
||||||
|
sdn.Tonnage.Should().Be("Tonnage");
|
||||||
|
sdn.GrossRegisteredTonnage.Should().Be("GrossRegisteredTonnage");
|
||||||
|
sdn.VesselFlag.Should().Be("VesselFlag");
|
||||||
|
sdn.VesselOwner.Should().Be("VesselOwner");
|
||||||
|
sdn.Remarks.Should().Be("Remarks");
|
||||||
|
sdn.Aliases.Should().BeEmpty();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user