60 lines
1.5 KiB
C#
60 lines
1.5 KiB
C#
using Heimdall.Domain.Entities;
|
|
using Shouldly;
|
|
|
|
namespace Heimdall.Domain.Tests.Entities;
|
|
|
|
public class UserGroupTests
|
|
{
|
|
[Fact]
|
|
public void Create_usergroup_should_set_properties()
|
|
{
|
|
var userId = Guid.NewGuid();
|
|
var groupId = Guid.NewGuid();
|
|
var ug = new UserGroup(userId, groupId);
|
|
|
|
ug.UserId.ShouldBe(userId);
|
|
ug.GroupId.ShouldBe(groupId);
|
|
}
|
|
}
|
|
|
|
public class UserSiteTests
|
|
{
|
|
[Fact]
|
|
public void Create_usersite_should_set_properties()
|
|
{
|
|
var userId = Guid.NewGuid();
|
|
var siteId = Guid.NewGuid();
|
|
var us = new UserSite(userId, siteId);
|
|
|
|
us.UserId.ShouldBe(userId);
|
|
us.SiteId.ShouldBe(siteId);
|
|
}
|
|
}
|
|
|
|
public class CameraDetectionProfileTests
|
|
{
|
|
[Fact]
|
|
public void Create_profile_should_set_camera_id()
|
|
{
|
|
var cameraId = Guid.NewGuid();
|
|
var profile = new CameraDetectionProfile(cameraId);
|
|
|
|
profile.CameraId.ShouldBe(cameraId);
|
|
}
|
|
|
|
[Fact]
|
|
public void Default_values_should_be_set()
|
|
{
|
|
var profile = new CameraDetectionProfile(Guid.NewGuid());
|
|
|
|
profile.DetectPerson.ShouldBeTrue();
|
|
profile.DetectVehicle.ShouldBeTrue();
|
|
profile.DetectMotion.ShouldBeTrue();
|
|
profile.FaceRecognition.ShouldBeTrue();
|
|
profile.LicensePlateRecognition.ShouldBeTrue();
|
|
profile.IdleIntervalMs.ShouldBe(1000);
|
|
profile.YoloModel.ShouldBe("yolov8n");
|
|
profile.MinConfidence.ShouldBe(0.4);
|
|
}
|
|
}
|